Jump to content

using mod_rewrite and force www


cane_cc72

Recommended Posts

My domain is apparently setup to not use www in the url so I was trying to use force www in htaccess my problem is using both I keep getting error  ERR_TOO_MANY_REDIRECTS

my htaccess looks like for mod_write for friendly url's

<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /index.php [L]
</IfModule>

with 1st attempt at adding force www of course i changed example.com to my boards url

<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /index.php [L]
# Always use www in the domain
# Replace 'example.com' with your domain name
 RewriteEngine on
 RewriteCond %{HTTP_HOST} ^([a-z.]+)?example\.com$ [NC]
 RewriteCond %{HTTP_HOST} !^www\. [NC]
 RewriteRule .? http://www.%1example.com%{REQUEST_URI} [R=301,L]
</IfModule>

 2nd attempt 

<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /index.php [L]
RewriteCond "%{HTTP_HOST}" "!^www\."         [NC]
RewriteCond "%{HTTP_HOST}" "(.*)"
RewriteRule "(.*)"         "http://www.%1$1" [R=301,L]
</IfModule>

both produced the same error ERR_TOO_MANY_REDIRECTS  

Link to comment
Share on other sites

Archived

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

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...