htaccess在所有页面上显示root index.php

时间:2017-03-03 14:59:56

标签: php apache .htaccess

我想将www.jainmunilocator页面重定向到jainmunilocator.org,所以我将以下代码添加到根目录中的htaccess

RewriteEngine on
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-l
RewriteRule ^(.*)$ index.php?url=$1 [QSA,L]
RewriteCond %{HTTP_HOST} ^www\.jainmunilocator\.org$
RewriteRule ^/?$ "http\:\/\/jainmunilocator\.org\/" [R=301,L]
RewriteCond %{HTTP_HOST} ^130\.211\.190\.222
RewriteRule (.*) http://www.jainmunilocator.org/$1 [R=301,L]
RewriteCond %{HTTP_USER_AGENT} libwww-perl.* 
RewriteRule .* ? [F,L]

但这引发了另一个问题。现在每当我打开子目录/它显示根index.php内容。如何避免?

0 个答案:

没有答案