想要重写网址,并希望从网址中删除“detail.php?read =”页面

时间:2016-12-17 07:19:50

标签: php .htaccess url

旧网址

http://localhost/detail.php?read=hair-loss-reasons

新网址

http://localhost/hair-loss-reasons

这是动态网址

当我们进入“detail.php?read = url”页面时,我想在所有网址中动态更改所有动态网址,并且应删除查询字符串变量“read”,网址名称或地址后直接显示网址托管它应该直接在本地主机上的localhost/url之后以及在某个站点运行时在服务器上

谢谢

1 个答案:

答案 0 :(得分:0)

在localhost的根目录中尝试这样。

RewriteEngine on
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^([\w-]+)$ detail.php?read=$1 [QSA,L]