我有一个文件夹,并在该文件夹中的htaccess文件的网站。对于该文件夹中的index.php文件,我想重写这个URL一定参数查询字符串,使打字:htaccess - 重写网址,使查询字符串不错
www.example.com/myfolder/myparameter
的行为是这样的(即让$_GET['parameter'] = 'myparameter'
在我的代码)
www.example.com/myfolder/index.php?parameter=myparameter
我已经看过StackOverflow上的很多问题,但还没有设法得到这个工作。我的代码到目前为止是
RewriteEngine on
RewriteCond %{QUERY_STRING} ^(.*) [NC]
RewriteRule ^$ %0 [QSA]
但这根本不起作用。
非常感谢,这个工程。但是,脚本,样式表和图片不再有效。这些网址的网址为www.example.com/myfolder/_images/image.png,www.example.com/myfolder/_scripts/script.js。你能帮我解决这些问题吗? – Will
请使用此 RewriteRule!\。(js | gif | jpg | png | css | txt | eot | woff | ttf)$ - [L] – somasundaram