所以我有这个帽子mod重写:
Options +FollowSymlinks
Options -MultiViews
RewriteEngine On
RewriteCond %{HTTP_HOST} ^www.mysite.com
RewriteRule (.*) http://mysite.com/$1 [R=301,L]
RewriteRule ^/(.*)$ find.php?q=$1 [NC]
RewriteRule ^/(.*)/([0-9])$ find.php?q=$1&psl=$2 [NC]
RewriteRule ^/(.*)/(.*)-links$ find.php?q=$1&hostas=$2 [NC]
RewriteRule ^/(.*)/(.*)-([0-9]+)$ details.php?id=$3 [NC]
问题是它在我的某个域上运行良好,并且在同一服务器(hostgator)上托管的其他域上但在其他目录中出现404错误。所需的文件find.php和detals.php确实存在于两个目录中。任何建议为什么它不起作用?
答案 0 :(得分:1)
它在托管在同一服务器上但在其他目录中的其他域上出现404错误
您必须将此文件夹定义为其他文件夹中mod-rewrite
的基础:
(...)
RewriteEngine On
RewriteBase /yourfolder/
RewriteCond %{HTTP_HOST} ^www.mysite.com
(...)