Welcome to WebmasterWorld Guest from 126.96.36.199
I have this line in .htaccess -
redirect permanent /forummessage.php http://www.example.com/
The problem is that it will redirect to www.example.com, but it will carry the variables over from forummessage.php if they click from Google.
So let's say that a page was forummessage.php?aid=17. Now, when I redirect, it is going to www.example.com?aid=17. I don't want the $aid to show up anymore. Any ideas? Thanks.
[edited by: jdMorgan at 3:08 pm (utc) on Dec. 8, 2007]
[edit reason] example.com [/edit]
Right, it's carrying the part of the URL after .php with them, that's what happens even if redirecting between subdirectories. Are all the URLs you're redirecting consecutive numbers, or are the some with numbers in between that are being left where they are? And about how many are there you're redirecting, just a few?
When you're doing a Redirect as you've indicated, it's actually the Redirect Directive in Mod_Alias:
You really aren't permanently moving them (301), you're eliminating them altogether, which techically, if you look at the documentation, would be a 410 permanently removed.
If you really don't care at all about PR or traffic, 410 is fine, but I personally *for sure* wouldn't use the homepage as the target URL of a 404 or a 410 redirect. I'd do a custom 410 error page of some sort, not only for search engine purposes, but so that anyone who tries to reach one of those old URLs in the future will see that they're gone and know where on the site to continue if they wish. A custom 410 page would accomplish that.
Another thing is that 300 URLs is a *whole* lot of URLs to be doing individually in .htaccess; so given that it's all of 300 URLs with the same URL pattern, you'd be better off using an Apache directive that supports regular expressions, which would enable you to specify the entire range of pages you've eliminated using only a couple of lines of code in .htaccess for far more efficiency and far less work.
mod_rewrite is regex based and would work, and it looks like there are some other directives in mod_alias that support regular expressions as well, and there could be other modules suited to this purpose. But this is where someone else will have to step in tell you the best, most efficient way and how to do it.
Here's just the thread you need to read:
mod_rewrite and regular expressions [webmasterworld.com]
There are more in the forum library [webmasterworld.com].
[edited by: Marcia at 9:31 am (utc) on Dec. 8, 2007]