homepage Welcome to WebmasterWorld Guest from
register, free tools, login, search, pro membership, help, library, announcements, recent posts, open posts,
Become a Pro Member

Home / Forums Index / Code, Content, and Presentation / Apache Web Server
Forum Library, Charter, Moderators: Ocean10000 & incrediBILL & phranque

Apache Web Server Forum

Can you redirect linking mistakes with .htaccess?
Like periods at the end of links from other sites

 7:48 pm on Jan 2, 2013 (gmt 0)

I regularly review my 404 errors and I notice that most of them are from errors in links from other sites. The most common example would be when they link to my site, but the link is at the end of a sentance and the period gets tossed into the link as well.
good = http://www.example.com/category/cool-widgets.php
bad = http://www.example.com/category/cool-widgets.php.

Can I make a general rule in the .htaccess that would fix errors like this as they happen (rather than 1 at a time like I do now) and what would that look like?



 7:50 pm on Jan 2, 2013 (gmt 0)

Yes, you can easily add rules for the most common typos - trailing period, comma, semi-colon and quote.

These rules must be early in the htaccess file, long before the non-www/www redirect but after any rules that block access to malicious requests.


 9:15 pm on Jan 2, 2013 (gmt 0)

... and keep that as a reminder to always check any links you yourself put up. Even if you've just come from the page and pasted directly from your address bar and you know it's the right URL. As in: [webmasterworld.com...] (Moderators! Don't fix that. I was illustrating the point ;))


 3:04 pm on Jan 7, 2013 (gmt 0)

Awesome, thank you for the help. :)

Global Options:
 top home search open messages active posts  

Home / Forums Index / Code, Content, and Presentation / Apache Web Server
rss feed

All trademarks and copyrights held by respective owners. Member comments are owned by the poster.
Home ¦ Free Tools ¦ Terms of Service ¦ Privacy Policy ¦ Report Problem ¦ About ¦ Library ¦ Newsletter
WebmasterWorld is a Developer Shed Community owned by Jim Boykin.
© Webmaster World 1996-2014 all rights reserved