Jump to content

Rewrite not redirect


emma57573

Recommended Posts

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]

Link to comment
Share on other sites

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?? )  :-\

Link to comment
Share on other sites

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  :-\

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.