I am trying to redirect one dynamic URL to another static URL. I wish domain.com/directory/url.php?id=3 to redirect to domain.com/item3.php and domain.com/directory/url.php?id=4 to redirect to domain.com/item4.php. I also wish to keep all other pages (domain.com/directory/url.php?id=xx) to remain as it is. Is it possible by anyway? Both are same domain and on the same server.
Should work if you simply redirect these two. RedirectMatch 301 ^/domain.com/directory/url.php?id=3 domain.com/item3.php RedirectMatch 301 ^/domain.com/directory/url.php?id=4 domain.com/item4.php
301 Redirect. Here is the code: "Options +FollowSymlinks RewriteEngine on rewritecond %{http_host} ^domain.com [nc] rewriterule ^(.*)$ http://www.domain.com/$1 [r=301,nc]". Kind Regards, RTH.
I figured it out using following codes: RewriteEngine On RewriteCond %{QUERY_STRING} ^id=3$ RewriteRule ^url.php$ /item3.php? [L,R=301] Code (markup): Here main URL: domain.com/directory/url.php?id=3 Redirected to: doamin.com/item3.php I put this code on the HTACCESS file in directory folder.