Forum Moderators: phranque

Message Too Old, No Replies

redirect dynamic to static.still not fully working

dynamic to static htaccess redirect 301

         

rankerous

7:02 am on Dec 16, 2008 (gmt 0)

10+ Year Member


I have followed every string I could find and have had some luck but still am not getting it right.

I had an old site with dynamically generated pages that is gone and it has been replaced by a WP blog. None of the old dynamically generated pages exist anymore.

I have:
http://www.sitename.com/lorum_ipsum.php?page=x

This works to get me to a specified category without the query string:
redirect 301 /lorum-ipsum.php http://www.sitename.com/category/uncategorized/?

and gives me:
http://www.sitename.com/category/uncategorized/

So far so good (I think), but how do I get it to go to the root (which I may use in some cases) without the query string? I can use the '?' at the end to eliminate the query string, but the '?' gets put in the url I see in my browser.

If I use this:
redirect 301 /lorum-ipsum.php http://www.sitename.com/?

I get:
http://www.sitename.com/?

It looks like the '?' doesn't effect the browser...it ignores the '?'.

How does a search engine see it? I need to make sure the redirect offers up the right url to both human and spider visitors.

I don't know why it doesn't show when I'm going to a folder and does if I go to the root. Is there a simple way to eliminate the '?' when going to the root? Does it matter?

What do I do with a url like this:
http://www.sitename.com/?page=8

I would like this to go to it's own area (/category/uncategorized2/...or whatever) but it currently goes to the root without any rule, I assume because the query string is ignored. How do I do this url? Can I even do it without 'rewrite'? I tried a bunch of 'rewrites' detailed here and none worked. I can not boot the server and have limited access, hence the need (I believe) to use htaccess.

Thanks!

jdMorgan

3:32 pm on Dec 16, 2008 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



You need to use mod_rewrite, both to remove the trailing "?" and to selectively redirect requests for the home page URL when a "page=" query string is appended.

The mod_alias Redirect and RedirectMatch directives are simple, but old and feature-limited, and can't do everything that you want to do.

Jim