Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
.htaccess with www and without www
#2
I'm no apache expert and I deal with it only if I have to, but as far as I'm aware, this should work:
Code:
# Usually RewriteBase is just '/', but
# replace it with your subdirectory path
RewriteBase /

RewriteCond %{HTTP_HOST} ^www.example.com$ [NC]
RewriteRule ^(.*)$ http://example.com/$1 [R=301,L]

RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule /?([A-Za-z0-9_-]+)/?$ index.php?id=$1 [QSA,L]
Reply


Messages In This Thread
.htaccess with www and without www - by xxdex - 2014-04-22, 06:15:55
RE: .htaccess with www and without www - by Everyone - 2014-04-22, 18:38:00



Users browsing this thread: 1 Guest(s)