Multiple conflicting htaccess RewriteRules

2019-09-17 22:13发布

I'm trying to have both people's profiles at example.com/Sara and a few special pages like example.com/home and /account.

How do I make both of my RewriteRules work?

Options +FollowSymLinks
RewriteEngine On

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

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

Thanks!

Edit:

Figured it out...!

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条回答
放荡不羁爱自由
2楼-- · 2019-09-17 22:57

Figured it out...!

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
查看更多
登录 后发表回答