本文介绍了htaccess的重定向与变数的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我知道有类似的问题,但我试图找出如何我可以重写以下网址:
I realise there are similar questions but I'm trying to work out how I can rewrite the following URL:
www.myWEBaddress/?month=200904
到
www.myWEBaddress/my-page.php?month=200904
问候
推荐答案以下内容添加到您的网站的根目录下的的.htaccess 文件。
Add the following to the .htaccess file in the root directory of your site.
RewriteEngine on RewriteBase / RewriteCond %{QUERY_STRING} (^|&)month= [NC] RewriteRule ^ my-page.php [L]如果你想改变用户看到他们的浏览器地址栏中的URL,最后一个规则更改为
If you want to change the URL that the user sees in their browser address bar, change the last rule to
RewriteRule ^ my-page.php [L,R=301]更多推荐
htaccess的重定向与变数
发布评论