IT.COM

.htaccess redirect

Spaceship
Watch
Impact
43
I want to redirect domain.se and www.domain.se
to www.domain.se/index.php?main_page=index&language=se
But i can only get the first to redirect how do i do with www.domain.se
Here is the code i have been using. I have only set up domain.se but how do i set up www.domain.se

Options +FollowSymlinks
RewriteEngine On
RewriteCond %{HTTP_HOST} !^(www\.|$) [NC]
RewriteRule ^ http://www.%{HTTP_HOST}%{REQUEST_URI}/index.php?main_page=index&language=se [L,R=301]
 
0
•••
The views expressed on this page by users and staff are their own, not those of NamePros.
0
•••
RewriteCond %{HTTP_HOST} ^www\.(.*)$ [NC]
RewriteRule ^(.*)$ http://%1/$1 [R=301,L]
 
0
•••
You can try this code for redirecting...

RewriteCond %{HTTP_HOST} ^www\.example\.com [NC]
RewriteRule ^(.*)$ http://example.com/$1 [L,R=301]
 
0
•••
  • The sidebar remains visible by scrolling at a speed relative to the page’s height.
Back