ron13315
Member
- Joined
- Jul 23, 2014
- Messages
- 283
- Points
- 18
hi.. how can you manage to redirect your domain.com into www.domain.com
I manage to do it in non wordpress site by adding this code in .htaccess
the trouble is its not working in wordpress site. I tried different format but its not working.
all this code below is not working in wordpress site
I manage to do it in non wordpress site by adding this code in .htaccess
Code:
RewriteEngine On
RewriteCond %{HTTP_HOST} !^www\.
RewriteRule ^(.*)$ http://www.%{HTTP_HOST}/$1 [R=301,L]
the trouble is its not working in wordpress site. I tried different format but its not working.
all this code below is not working in wordpress site
Code:
RewriteCond %{HTTP_HOST} ^domain\.com [NC]
RewriteRule ^(.*) http://www.domain.com/$1 [R=301,L]
Code:
# BEGIN WordPress
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /
RewriteCond %{HTTP_HOST} ^domain\.com [NC]
RewriteRule ^(.*) http://www.domain.com/$1 [R=301,L]
</IfModule>
# END WordPress
Code:
# BEGIN WordPress
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /
RewriteRule ^index\.php$ - [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /index.php [L]
RewriteCond %{HTTP_HOST} ^domain\.com [NC]
RewriteRule ^(.*) http://www.domain.com/$1 [R=301,L]
</IfModule>
# END WordPress