Welcome to WebmasterWorld Guest from 54.205.115.177

Forum Moderators: Ocean10000 & incrediBILL & phranque

Message Too Old, No Replies

Need Help in Creating htaccess Rule

   
12:19 pm on May 20, 2013 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Our 404s in GWT has spiked in the last couple of months, and Google has been seeing hundreds of errors of this kind:


www.URL.com/category/page/196?nomobile
www.URL.com/category/page/197?nomobile
www.URL.com/category/page/198?nomobile
www.URL.com/category/page/199?nomobile
www.URL.com/category/page/200?nomobile
www.URL.com/category/page/201?nomobile
www.URL.com/category/page/202?nomobile
www.URL.com/category/page/203?nomobile
www.URL.com/category/page/204?nomobile


Instead of writing 500+ redirects in my .htaccess file, I think this can be handled by writing a redirect rule. Unfortunately, I don't know how to write rules in htaccess files. I want these 404s as GWT reports to be gone and instead redirect to www.URL.com/category

I'd greatly appreciate it if someone could help me craft the rewrite rules for the above

Thanks
4:09 pm on May 20, 2013 (gmt 0)

WebmasterWorld Senior Member lucy24 is a WebmasterWorld Top Contributor of All Time Top Contributors Of The Month



It can certainly be done with a single RewriteRule with a RewriteCond looking at %{QUERY_STRING}. But you haven't given enough information. Do you want to exclude all requests with the "nomobile" parameter? Do these requests ever include other parameters that you need to keep? Do some values of "nomobile" have meaning?

If it's purely a garbage parameter, Option B is to go into gwt and tell it to either ignore the parameter or ignore all URLs containing the parameter. (Careful! That's two different processes.)

You've been around long enough to know that we don't approve of writing rules for people to cut and paste. But if you post your best effort, someone will explain what's wrong with it so you can learn how to do it yourself. (Yes, this takes much longer than just doing it for you. It's the same principle as forcing your children to clean their own rooms-- including the stuff under the bed-- instead of just doing it yourself ;))
4:18 pm on May 20, 2013 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



I think I'll just go with the GWT option (I'd rather not tinker with redirects)

I've set it to NO URLs so Google doesn't have to crawl these URLs because they don't really exist
8:56 pm on May 20, 2013 (gmt 0)

WebmasterWorld Administrator phranque is a WebmasterWorld Top Contributor of All Time 10+ Year Member Top Contributors Of The Month



any requested url that gets a 200 OK response "exists".
9:17 pm on May 20, 2013 (gmt 0)

WebmasterWorld Senior Member lucy24 is a WebmasterWorld Top Contributor of All Time Top Contributors Of The Month



any requested url that gets a 200 OK response "exists".

The OP said they're getting 404s, so these really don't exist. If nobody but google is asking for them, the gwt solution is definitely easiest :)
8:28 am on May 21, 2013 (gmt 0)

WebmasterWorld Administrator phranque is a WebmasterWorld Top Contributor of All Time 10+ Year Member Top Contributors Of The Month



OP said they're getting 404s

sorry for my irrelevant answer - i don't always read the entire thread when i'm on a mobile device and thought i was answering a different thread.


i agree with lucy24 - if those urls are good without the query string and only googlebot is requesting them, use the GWT ignore parameter option.
if you are getting direct (human) visitors or referred traffic for those urls, you'll want to implement a redirect.