【发布时间】:2011-08-16 02:47:42
【问题描述】:
我发现了很多关于在共享主机计划中安装 Symfony 1.4 的有用信息,但是我遇到了一个让我困惑了一整天的绊脚石。
转到 http://www.alternium.net/jobeet/index.php 返回 404 而不是 http://www.alternium.net/jobeet/web/index.php 处的文件。
/jobeet/.htaccess:
Options +FollowSymLinks +ExecCGI
# Enable rewrite engine and route requests to framework
RewriteEngine On
RewriteBase /
RewriteCond %{REQUEST_URI} ^/robots.txt
RewriteRule ^(.*)$ /jobeet/web/robots.txt [L]
# resources
RewriteCond %{REQUEST_URI} ^/images/ [OR]
RewriteCond %{REQUEST_URI} ^/js/ [OR]
RewriteCond %{REQUEST_URI} ^/fonts/ [OR]
RewriteCond %{REQUEST_URI} ^/css/
RewriteRule ^(.*)$ /jobeet/web/$1 [L]
RewriteCond %{REQUEST_URI} !^/jobeet/web/
RewriteCond %{REQUEST_URI} !^/frontend_dev.php
RewriteRule ^(.*)$ /jobeet/web/index.php/$1 [QSA,L]
RewriteCond %{REQUEST_URI} frontend_dev.php
RewriteRule ^$ /jobeet/web/$1 [QSA,L]
/jobeet/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]
RewriteCond %{REQUEST_URI} \..+$
RewriteCond %{REQUEST_URI} !\.html$
RewriteCond %{REQUEST_URI} !\.php
#RewriteCond %{REQUEST_URI} !\.php
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>
谁能比我更了解 Symfony 或重写规则,告诉我哪里出错了?
【问题讨论】:
标签: .htaccess mod-rewrite symfony1 symfony-1.4