bradh Posted June 29, 2009 Share Posted June 29, 2009 Hi guys, I'm working on a site, let's call it abc. The problem I'm having is when I navigate to http://www.abc.com/ the site works perfectly. All the select lists are populated via ajax, scripts are all loading and executing correctly. BUT When I navigate to http://abc.com/ the site still shows, but all the javascript stuff isn't working as it should. The lists aren't populated etc. Is there a way I can redirect all pages calling http://abc.com/etc.. to http://www.abc.com/etc..? I haven't found a solution to it yet. Thanks Link to comment https://forums.phpfreaks.com/topic/164077-help-with-tricky-redirection/ Share on other sites More sharing options...
gevans Posted June 29, 2009 Share Posted June 29, 2009 You should direct your domain to the www. sub-domain anyway. Search Engines like this as they then see it as one domain, rather than a domain and a sub-domain. This can be achieved by adding a htaccess file with the following; RewriteEngine On RewriteCond %{HTTP_HOST} ^abc.com RewriteRule (.*) http://www.abc.com/$1 [R=301,L] Link to comment https://forums.phpfreaks.com/topic/164077-help-with-tricky-redirection/#findComment-865544 Share on other sites More sharing options...
bradh Posted June 29, 2009 Author Share Posted June 29, 2009 Thanks, that would indeed solve all my problems Thought about using $_SERVER['HTTP_HOST'] and set up a conditional, but don't think it gets the www part of the URL. Link to comment https://forums.phpfreaks.com/topic/164077-help-with-tricky-redirection/#findComment-865579 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.