清洁URL htaccess的 -
问题描述:
我如何与htaccess文件的URL http://www.example.com/index.php?p=1 所以它看起来像这样重写: http://www.example.com/index.php清洁URL htaccess的 -
答
尝试添加此:
RewriteEngine On
RewriteRule ^/?index.php$ http://www.example.com/? [L,R=301]
谢谢(P = 1?)为了快速反应! 我有几页,12是正确的:) 和URL结束?p = 1,?p = 2,?p = 3,?p = 4,... –
我更新了对应的答案 –
最后一个问题,我希望:) 所以,如果我想在所有网站上创建“干净的网址”,我只写这个: RewriteEngine在 RewriteRule^/?index.php $ http://www.example.com/? [L,R = 301] RewriteRule^/?gallery.php $ http://www.example.com/? [L,R = 301] RewriteRule^/?contact.php $ http://www.example.com/? [L,R = 301] –