Jump to content

Help with tricky redirection


bradh

Recommended Posts

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

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]

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.