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.
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
<IfModule mod_rewrite.c>
RewriteEngine on
RewriteRule ^mysubsite/(.*) index.php?q=$1 [NC,L,QSA]
</IfModule>
精彩评论