我无法弄清楚如何将这个URL改写为页面和用户配置文件的规则
http://localhost/site/page.php?id=[pagetitle]
改写为
http://localhost/site/page/title
和 用户配置文件
http://localhost/site/profile.php?username=username
到
http://localhost/site/profile/username
这是我使用的代码:
RewriteEngine On
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^profile(.*)$ profile.php?username=$1
RewriteRule ^(.*)$ page.php?title=$1
RewriteEngine叙述在 的RewriteCond%{} REQUEST_FILENAME!-f 的RewriteCond%{} REQUEST_FILENAME!-d 重写规则^ profile(。*)$ profile.php?username = $ 1 RewriteRule ^( 。*)$ page.php?title = $ 1 – Dinho
你可以用它更新问题。它可能会给你一个更积极的分数 – Philibobby