我想使用.htaccess文件将html和xml文件和目录重写为pagename查询字符串。像这样:
mysubsite / category_1 / category_2 / mysubsite / category_1 / category_2 /的file1.html mysubsite / category_1 / category_2 / file2.152.html
的index.php?页面名= category_1 / category_2 / 的index.php?页面名= category_1 / category_2 /的file1.html 的index.php?页面名= category_1 / category_2 / file1.152.html
谢谢你的帮助。
答案 0 :(得分:0)
你有
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?页面名= category_1 / category_2 / file1.152.html
<IfModule mod_rewrite.c>
RewriteEngine on
RewriteRule ^mysubsite/(.*) index.php?q=$1 [NC,L,QSA]
</IfModule>