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

Visit PubCon.com
Home / Forums Index / Hardware and OS Related Technologies / Website Technology Issues
Forum Library, Charter, Moderators: phranque

Website Technology Issues Forum

    
Redirect issue .htaccess
w00t




msg:4694931
 8:27 pm on Aug 12, 2014 (gmt 0)

Pls help me to do that.

Many links in different post messages like
http://www.site.com/www.example.com

www.site.com - my site
www.example.com - site with data.

Because www.example.com is any site i reffer (used for post message material).. needs following.

When any click on
http://www.site.com/www.example.com must only open correctly www.example.com

Firefox said that url is invalid url. Needs redirect in htaccess, but how do that...

 

not2easy




msg:4694948
 10:11 pm on Aug 12, 2014 (gmt 0)

Hi w00t - welcome to the Forums. Yes, they're definitely invalid and can't go anywhere. Where do these prefixed links come from? Are they generated by a CMS?

phranque




msg:4697501
 10:44 am on Aug 23, 2014 (gmt 0)

welcome to WebmasterWorld, w00t!


Many links in different post messages like
http://www.site.com/www.example.com


this is most likely caused by urls being posted without the leading protocol specification (http://) which are treated by the browser as relative urls.
you could fix this by editing or processing the posted urls.

otherwise you should use mod_rewrite to redirect these requests to the proper hostname.
the difficulty is reliable recognizing these external urls so they can be captured for the back reference in the RewriteRule (while excluding local urls from redirecting).

Global Options:
 top home search open messages active posts  
 

Home / Forums Index / Hardware and OS Related Technologies / Website Technology Issues
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