PHP 시작 스크립트 :Symfony 1.4 : 맞춤 도메인의 두 번째 앱?
주요 응용 프로그램 :
~ec2-user/project/web/index.php
차 응용 프로그램 :
~ec2-user/project/web/api1.php
아파치 설정 :
-
0
발췌 :
이<VirtualHost *:80> ServerName example.com DocumentRoot /home/ec2-user/project/web DirectoryIndex index.html index.php <Directory /home/ec2-user/project/web> AllowOverride All Allow from All </Directory> </VirtualHost> <VirtualHost *:80> ServerName 1.api.example.com # 1: version number DocumentRoot /home/ec2-user/project/web <Directory /home/ec2-user/project/web> AllowOverride None </Directory> RewriteEngine On RewriteRule ^(.*)$ /api1_dev.php [QSA,L] </VirtualHost>
~ec2-user/project/web/.htaccess
(전용 주 응용 프로그램에 적용해야합니다) : 예상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>
/etc/httpd/conf/httpd.conf
에서
어떤 부하로 :
http://example.com
: 홈 페이지http://example.com/api1.php/foo/bar
: 일부 JSON 데이터
무엇을하지 않습니다로드 :
http://1.app.example.com/foo/bar
:404 | 찾을 수 없음 | sfError404Exception
"/"(/) URL을 구문 분석 한 후 모듈 및/또는 동작이 비어 있습니다.
[...]
나는 무엇을 놓치고? ~ EC2 사용자/프로젝트/웹/htaccess로에서
이 1.app.example.com''의 구성에'에 AllowOverride None'을 유의하시기 바랍니다 : 난 단지
$1
이 필요하지, 왜example.com
에 대한.htaccess
에서 궁금'.htaccess'은 아니다 해석하고, 그것을 바꾸는 것은 효과가 없다. – feklee