多个htaccess重写规则

时间:2016-09-01 12:47:24

标签: .htaccess

我正在使用下面的htaccess文件。第一个工作正常。但第二个工作正常。

RewriteEngine On
RewriteBase /Epropertiesnew/

RewriteCond %{THE_REQUEST} /Properties(?:\.php)?\?project=([^&]+)&property=([^\s&]+) [NC]
RewriteRule ^ %1/%2? [R=302,L,NE]

RewriteCond %{THE_REQUEST} /ViewNewProjects(?:\.php)?\?newproject=([^&]+)&url=([^\s&]+) [NC]
RewriteRule ^ %1/%2? [R=302,L,NE]

# skip all files and directories from rewrite rules below
RewriteCond %{REQUEST_FILENAME} -d [OR]
RewriteCond %{REQUEST_FILENAME} -f
RewriteRule ^ - [L]

# PHP hiding rule
RewriteCond %{REQUEST_FILENAME}.php -f
RewriteRule ^(.*)$ $1.php [L]

RewriteRule ^([A-Z,0-9-]+)/([A-Z,0-9-]+)/?$ Properties.php?project=$1&property=$2 [NC,L,QSA]

RewriteRule ^([A-Z,0-9-]+)/([A-Z,0-9-]+)/?$ ViewNewProjects.php?newproject=$1&url=$2 [NC,L,QSA]

如果我评论了第一个,第二个工作正常。请帮我解决这个问题。

0 个答案:

没有答案