emma57573 Posted April 5, 2009 Share Posted April 5, 2009 The following code works by redirecting, example: www.mydomain.co.uk/gifts/art.html goes to http://www.mydomain.co.uk/handmade-gifts.php?cid=Art Thats all great and works HOWEVER It redirects (which yes is what I wanted) BUT the address bar changes to the long address but what I really want to do is keep the clean address in the address bar to fool SE into thinking they are looking at www.mydomain.co.uk/gifts/art.html as a static page. I know this must be possible as Ive seen lots of sites doing the same thing what am I doing wrong? I should add im new to .htaccess and learning as I go! Options +FollowSymlinks RewriteCond %{HTTP_HOST} ^www.mydomain.co.uk RewriteRule ^gifts\/(.*)\.html http://www.mydomain.co.uk/handmade-gifts.php?cid=$1 [NC] Quote Link to comment Share on other sites More sharing options...
emma57573 Posted April 8, 2009 Author Share Posted April 8, 2009 I still havnt had a chance to dig deep into this, anyone have an suggestions?? I thought when I did the mod rewrite it would change the domain and so the domain would stay in the address bar but it seems all it does is send a redirect. I want to use this rule for all my dynamic pages, but I dont want this type of redirection as I dont want to get penalized by google for having redirects everywhere! Maybe Im barking up the wrong tree with .htaccess altogether and theres another way round it altogether. As I said its going to the right page and the link its right every things good apart from the fact the the redirection shows the dynamic page in the menu bar. I just dont want it to look like a redirection (even though it kind of is?? ) :-\ Quote Link to comment Share on other sites More sharing options...
corbin Posted April 9, 2009 Share Posted April 9, 2009 Change RewriteRule ^gifts\/(.*)\.html http://www.mydomain.co.uk/handmade-gifts.php?cid=$1 [NC] to RewriteRule ^gifts\/(.*)\.html /handmade-gifts.php?cid=$1 [NC] Quote Link to comment Share on other sites More sharing options...
emma57573 Posted April 10, 2009 Author Share Posted April 10, 2009 Thank you, the only reason I put the full domain in was because it was looking for a directory ive added ../ and its fine now thanks. However its still showing as a redirect and showing the full domain in the address bar instead of my nice new clean domain :-\ Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.