symfony 1.4에서 라우팅 및 envirenement 또는 모듈에 관한 심각한 문제가있어서 프런트 엔드, 모바일 및 백엔드의 세 가지 모듈을 만들었습니다. 프론트 엔드 및 모바일 모듈 그래서symfony 1.4의 라우팅 및 모듈
, 나는 거의 같은 라우팅을 사용하고 있습니다 :
//apps/frontend/config/routing.yml
home:
url: /home
param: { module: user, action: home }
homepage:
url: /
param: { module: content, action: index }
....
default_index:
url: /:module
param: { action: index }
default:
url: /:module/:action/*
모바일 모듈 : 내 사이트에 액세스 할 수있는 링크를 사용
//apps/mobile/config/routing.yml
home:
url: /home
param: { module: user, action: home }
homepage:
url: /
param: { module: sfGuardAuth, action: signin }
....
default_index:
url: /:module
param: { action: index }
default:
url: /:module/:action/*
mysite.com/ ==> frontend module(frontend.php)
mysite.com/mobile.php ==> mobile module(mobile.php)
문제는 내가 모바일 버전에 로그인 페이지를 올바르게 액세스하지만 로그인 후에 그들이 나를 h로 리디렉션 할 때입니다. 프론트 엔드 모듈의 omepage는 모바일 모듈의 홈 페이지가 아닌가?
비고 : 내가 dev에 ENV와이 링크 mysite.com/mobile_dev.php
를 사용할 때
모바일 버전은 매우 잘 작동!
편집 : 여기
내 htaccess로이다 : 그래서mobile.php
에
mysite.com/mobile.php
모바일 버전 홈페이지에 직접 가서 모두가 잘 작동 링크를
index.php
을 변경할 때
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteCond %{QUERY_STRING} ^(%2d|-)[^=]+$ [NC]
RewriteRule ^(.*) $1? [L]
</IfModule>
Options +FollowSymLinks +ExecCGI
<IfModule mod_rewrite.c>
RewriteEngine On
# uncomment the following line, if you are having trouble
# getting no_script_name to work
RewriteBase/
# we skip all files with .something
#RewriteCond %{REQUEST_URI} \..+$
#RewriteCond %{REQUEST_URI} !\.html$
#RewriteRule .* - [L]
# we check if the .html version is here (caching)
RewriteRule ^$ index.html [QSA]
RewriteRule ^([^.]+)$ $1.html [QSA]
RewriteCond %{REQUEST_FILENAME} !-f
# no, so we redirect to our front web controller
RewriteRule ^(.*)$ index.php [QSA,L]
</IfModule>
...
이제 내 문제는 내 .htaccess를 수정하여 다음과 같이 리디렉션하는 방법입니다.
mysite.com/index.php or mysite.com/ redirect me to my site
mysite.com/mobile.php redirect me to mobile version
Edit2가 :
나는이 링크 mysite.com/mobile.php
로 시작할 때 그래서 페이지를 로그인 모바일 애플 리케이션에 나를 리디렉션을 설명하지만, 로그인 후 대신 그것을 점을 내 홈페이지에 새로운 요청 검색 기본 전면 컨트롤러를 갈 때 index.php에서 프론트 엔드 앱의 홈페이지를 모바일 앱이 아닌 내게 알려주세요!
mobile_dev.php
의 symfony가 우리가 모바일 dev env에 항상 머물러 있고 mobile.php
으로 이동하면 모바일 모바일 환경에서 프런트 엔드 환경으로 첫 번째 리디렉션으로 전환됩니까?
모든'settings.yml' 파일에 오직 하나의 ['no_script_name : true'] (http://symfony.com/legacy/doc/reference/1_4/en/04-Settings#chapter_04_sub_no_script_name)가 있는지 확인해야합니다 . – 1ed
프론트 엔드와 모바일에서 네, 그들은 no_script_name입니다 : 그들 모두 안에있는 모든 설정. – Nll
이것은 잘못된 구성을 의미합니다 ... 링크 된 문서를 읽어야합니다. – 1ed