1

I have an htaccess file that is supposed to direct the user to a non www URL. Problem is, the site has directories that get added to the end of the URL when clicked on.

For example, subdomain.domain.com becomes subdomain.domain.com/folder/home.html, which is fine, but if the link is clicked again, it becomes subdomain.domain.com/folder/folder/home.html, and so on. Not so good.

Here is the .htaccess file:

RewriteEngine On
RewriteBase /

# Rewrite www.domain.com -> domain.com -- used with SEO Strict URLs plugin
RewriteCond %{HTTP_HOST} .
RewriteCond %{HTTP_HOST} !^subdomain\.domain\.com [NC]
RewriteRule (.*) http://subdomain.domain.com/$1 [R=301,L]
#
# or for the opposite domain.com -> www.domain.com use the following
# DO NOT USE BOTH
#
#RewriteCond %{HTTP_HOST} .
#RewriteCond %{HTTP_HOST} !^www\.sitehere\.com [NC]
#RewriteRule (.*) http://www.sitehere.com/$1 [R=301,L]

# The Friendly URLs part
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ index.php?q=$1 [L,QSA]



# Make sure .htc files are served with the proper MIME type, which is critical
# for XP SP2. Un-comment if your host allows htaccess MIME type overrides.

#AddType text/x-component .htc


<FilesMatch "\.(ttf|otf|eot|woff)$">
  <IfModule mod_headers.c>
    Header set Access-Control-Allow-Origin "*"
  </IfModule>
</FilesMatch>

Any help would be greatly appreciated.

Thanks!

symlink
  • 11,984
  • 7
  • 29
  • 50
  • Maybe you'll find the answer here: http://stackoverflow.com/questions/234723/generic-htaccess-redirect-www-to-non-www – bmiljevic Oct 30 '14 at 09:27

1 Answers1

0

check your base href tag in your templates and the system variable it outputs, I think it's ++site_url [you can check in your template what it actually is]

Sean Kimball
  • 4,506
  • 9
  • 42
  • 73