how do I redirect a user to a certain page using .htaccess
I have the following rule defined in the .htaccess file of my webapplication's root directory.
RewriteCond %{REQUEST_URI} !^/classes/captcha.php
RewriteRule ^([^/]*)/([^/]*)$ /index.php?client=$1&page=$2 [L]
this rule give the facility of typing the url like this xyz.com/开发者_如何学运维abc/page1
which is in original is equal to xyz.com/index.php?client=abc&page=page1
Now what I want is that when a user types in http://xyz.com/abc/page1
, the address bar of the browser should display the original url i.e. 'http://xyz.com/index.php?client=abc&page=page1'
currently if I type "http://xyz.com/abc/page1
" the address bar url doesn't change.
Please help me modify this rule.
Thanks.
Try adding the redirect flag:
RewriteRule ^([^/]*)/([^/]*)$ /index.php?client=$1&page=$2 [R=301, L]
精彩评论