Htaccess RewriteCond带我到404 - 文件夹存在

时间:2016-08-22 12:15:57

标签: apache .htaccess mod-rewrite

我有两个htaccess重写条件:

RewriteCond %{HTTP_HOST} ^(www\.)?gotham.rentals$
RewriteRule !^gothamrentals/ /gothamrentals%{REQUEST_URI}  [L]

RewriteCond %{HTTP_HOST} ^(www\.)?sofla.biz$
RewriteRule !^southflorida/ /southflorida%{REQUEST_URI}  [L]

第一个工作,第二个不工作(404来自服务器)。是什么赋予了?文件夹southflorida存在,并且具有与文件夹gothamrentals相同的权限。

1 个答案:

答案 0 :(得分:1)

我使用的答案是:

RewriteEngine On
RewriteBase /
RewriteRule ^index\.php$ - [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /index.php [L]

到southflorida目录。我怀疑,也许" /"正在加入网址,而孩子htaccess正在照顾那些犯罪分子。