我想通过htaccess重写一个URL,但是我没有得到解决方案来完成特定的重写。例如,我有一个URL:
http://www.yourdomain.com/page/about-us.html
现在我想从上面的网址中删除页面,所以它应该看起来像;
http://www.yourdomain.com/about-us.html
有人能帮我吗。
提前谢谢。
发布于 2011-11-25 09:58:15
像这样的事情应该有效:
RewriteEngine on
RewriteRule ^about-us.html$ /page/about-us.html如果您需要在放置到该站点的任何URL上完成该操作,则如下所示:
RewriteEngine on
RewriteRule ^([_\&\'\,\+A-Za-z0-9-]+).html$ /page/$1.html发布于 2011-11-25 09:58:19
假设你想要301:
RewriteEngine on
RewriteRule ^page/about-us.html$ /about.html [R=301,L]https://stackoverflow.com/questions/8267254
复制相似问题