How to redirect specific url from non-www to www?


#1

I want to redirect a specific page from "example.com/abc/" to "www.example.com/abc" through .htaccess file. How can I do this?


#2

I tried using this code (non-www to www) and it works for me. Hope this can help.

RewriteEngine On
RewriteCond %{HTTP_HOST} !^www\.
RewriteRule ^(.*)$ http://www.%{HTTP_HOST}/$1 [R=301,L]

#3

//Rewrite to www
Options +FollowSymLinks
RewriteEngine on
RewriteCond %{HTTP_HOST} ^abc.com/abc[nc]
RewriteRule ^(.*)$ http://www.abc.com/abc/$1 [r=301,nc]

#4

This topic was automatically closed 91 days after the last reply. New replies are no longer allowed.