我将如何编写 RewriteRule 来进行重定向
我想使用 .htaccess 文件将 html 和 xml 文件和目录重写为页面名称查询字符串。像这样:
mysubsite/category_1/category_2/ mysubsite/category_1/category_2/file1.html mysubsite/category_1/category_2/file2.152.html
index.php?pagename=category_1/category_2/ index.php?pagename=category_1/category_2/file1.html index.php?pagename=category_1/category_2/file1.152.html
感谢您的帮助。
I want to rewrite the html and xml files and directories to the pagename query string using .htaccess file. like this :
mysubsite/category_1/category_2/
mysubsite/category_1/category_2/file1.html
mysubsite/category_1/category_2/file2.152.html
index.php?pagename=category_1/category_2/
index.php?pagename=category_1/category_2/file1.html
index.php?pagename=category_1/category_2/file1.152.html
Thanks for you help.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
您有
mysubsite/category_1/category_2/ mysubsite/category_1/category_2/file1.html mysubsite/category_1/category_2/file2.152.html
和
index.php?pagename=category_1/category_2/index.php?pagename=category_1/category_2/file1 .html index.php?pagename=category_1/category_2/file1.152.html
我想您的意思是:
mysubsite/category_1/category_2/
mysubsite/category_1/category_2/file1.html
mysubsite/category_1/category_2/file2.152 .html
和
index.php?pagename=category_1/category_2/
index.php?pagename=category_1/category_2/file1.html
index.php?pagename=category_1/category_2/file1.152.html
You have
mysubsite/category_1/category_2/ mysubsite/category_1/category_2/file1.html mysubsite/category_1/category_2/file2.152.html
and
index.php?pagename=category_1/category_2/ index.php?pagename=category_1/category_2/file1.html index.php?pagename=category_1/category_2/file1.152.html
And I'm supposing that you meant:
mysubsite/category_1/category_2/
mysubsite/category_1/category_2/file1.html
mysubsite/category_1/category_2/file2.152.html
and
index.php?pagename=category_1/category_2/
index.php?pagename=category_1/category_2/file1.html
index.php?pagename=category_1/category_2/file1.152.html