Welcome to WebmasterWorld Guest from 184.73.122.162

Forum Moderators: Ocean10000 & incrediBILL & phranque

Message Too Old, No Replies

redirecting URLs with %20 in string

     
5:10 am on Dec 30, 2010 (gmt 0)

Junior Member

10+ Year Member

joined:Sept 18, 2002
posts: 143
votes: 0


I have numerous pages showing up in Google Webmaster tools that are not found. These are links from other sites linking to my site. The links are broken because of an extra space added to the URL (%20 characters).

Is there a way to redirect a link from
http://www.example.com%20
to
http://www.example.com

Thanks
6:07 pm on Dec 30, 2010 (gmt 0)

Administrator from US 

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

joined:Sept 21, 1999
posts:38066
votes: 15


Ya, you can quote the filename/directory name in an htaccess redirect rule.
5:35 pm on Jan 5, 2011 (gmt 0)

Senior Member

WebmasterWorld Senior Member jdmorgan is a WebmasterWorld Top Contributor of All Time 10+ Year Member

joined:Mar 31, 2002
posts:25430
votes: 0


Assuming that you already have other RewriteRules set up and working in example.com/.htaccess:

RewriteRule ^(.*)\ +$ http://www.example.com/$1 [R=301,L]

Place this new rule before your domain canonicalization redirect (if you have one) and before all internal rewrites. You should modify any and all more-specific URL redirects (which should precede this new rule) to allow for the optional presence of this trailing space as well.

Jim