Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我一直在谷歌搜索,但找不到答案。
我有这个网址:
www.mysite.com/index.php?tip=1
(分别www.mysite.com/?tip=1)
www.mysite.com/?tip=1
并希望它重写为:
www.mysite.com/tip/1
您的帮助将不胜感激。
您需要在 apache 配置中启用重写模块,并将以下设置放在您的基本文件夹的 .htaccess 文件中
RewriteEngine on RewriteCond %{REQUEST_FILENAME} !-d RewriteCond %{REQUEST_FILENAME} !-f RewriteRule ^tip/(.*) /index.php?tip=$1 [L,NC,QSA]