homepage Welcome to WebmasterWorld Guest from 54.145.191.14
register, free tools, login, search, pro membership, help, library, announcements, recent posts, open posts,
Pubcon Platinum Sponsor 2014
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
hannamyluv

WebmasterWorld Senior Member 10+ Year Member



 
Msg#: 4532595 posted 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.
e.g.
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?

 

g1smd

WebmasterWorld Senior Member g1smd us a WebmasterWorld Top Contributor of All Time 10+ Year Member



 
Msg#: 4532595 posted 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.

lucy24

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



 
Msg#: 4532595 posted 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 ;))

hannamyluv

WebmasterWorld Senior Member 10+ Year Member



 
Msg#: 4532595 posted 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