I have two domains and each are on the same server, have the same type of script running on each domain and have the same values in their .htaccess files. the first site's domain is in this structure: http://www.domain.com Code (markup): the second one is this way: http://domain.com Code (markup): I can't get it to add the www before the domain. The first domain has traffic while the second one has none. Can this be related somehow? How do I get the second one to display with "www"? Even when I add www, the relative links appear without it when you hover over them.
You could use mod_rewrite to redirect all traffic to www <IfModule mod_rewrite.c> RewriteEngine On RewriteBase / #redirect domain.xyz to [url]www.domain.xyz[/url] RewriteCond %{HTTP_HOST} ^domain\.xyz$ [NC] RewriteRule ^(.*)$ http://www.domain.xyz/$1 [R=301,L] </IfModule> Code (markup): If mod_rewrite is loaded and you place this code in your .htaccess file all requests are redirected to www
Yes, but every second level link would still go back to http://domain.com/subdirectory Code (markup): Wouldn't it? I guess I'm just wondering how it could do what it's doing without me setting it up that way.
Maybe I haven't understood your situation completely. But with the code I posted requests without www are no longer possible, all get redirected. If this is not what you mean please make an example for "every second level link would still go back to ...".