多个冲突的htaccess RewriteRules

时间:2011-07-18 06:07:21

标签: .htaccess rewrite

我正在尝试在example.com/Sara上找到两个人的个人资料以及一些特殊页面,例如example.com/home和/ account。

如何让我的两个RewriteRules都有效?

Options +FollowSymLinks
RewriteEngine On

RewriteCond %{SCRIPT_FILENAME} !-d
RewriteCond %{SCRIPT_FILENAME} !-f

RewriteRule ^(.*)$ ./people.php?s=$1
RewriteRule ^home ./home.php

谢谢!

编辑:

想出来......!

Options +FollowSymLinks
RewriteEngine On

RewriteCond %{REQUEST_FILENAME} !-d 
RewriteCond %{REQUEST_FILENAME}\.php -f 
RewriteRule ^(.*)$ $1.php

RewriteCond %{SCRIPT_FILENAME} !-d
RewriteCond %{SCRIPT_FILENAME} !-f

RewriteRule ^(.*)$ ./people.php?s=$1

1 个答案:

答案 0 :(得分:0)

想出来......!

Options +FollowSymLinks
RewriteEngine On

RewriteCond %{REQUEST_FILENAME} !-d 
RewriteCond %{REQUEST_FILENAME}\.php -f 
RewriteRule ^(.*)$ $1.php

RewriteCond %{SCRIPT_FILENAME} !-d
RewriteCond %{SCRIPT_FILENAME} !-f

RewriteRule ^(.*)$ ./people.php?s=$1