This example is based on a url with incoming query string empty. The trick is to use a RewriteCond to match the empty query string portion of the URL, and a regular RewriteRule to match the path.
<virtualhost>
ServerAdmin awesome@test.com DocumentRoot C:\test ServerName test.com <directory test="">Order allow,deny Allow from all AllowOverride All </directory> RewriteEngine On RewriteCond %{REQUEST_URI} ^/web/guest/myurl/$ RewriteCond %{QUERY_STRING} ^$ RewriteRule ^(.*)$ http://www.mynewdomain.com/ [R=301,L]
</virtualhost>As result the url
http://www.mycurrentsite.com/web/guest/myurl/ will be redirect to http://www.mynewdomain.com/
the url
http://www.mycurrentsite.com/web/guest/myurl/?id=576576 will not be redirect.
0 comments:
Post a Comment