.htaccess – How to redirect to www. url?
-
I want to redirect all pages on my site to the url with www.
Example:
https://domain.com/wordpress/archives/1
https://www.domain.com/wordpress/archives/1I use the below on my .htaccess on non wordpress site.
RewriteEngine On
RewriteCond %{HTTP_HOST} ^domain.com$
RewriteRule ^(.*)$ https://www.domain.com/$1 [R=301,L]
ErrorDocument 400 https://www.domain.com
ErrorDocument 401 https://www.domain.com
ErrorDocument 403 https://www.domain.com
ErrorDocument 404 https://www.domain.com
ErrorDocument 500 https://www.domain.com
IndexIgnore *How can I do the same thing to a wordpress directory?
Viewing 2 replies - 1 through 2 (of 2 total)
Viewing 2 replies - 1 through 2 (of 2 total)
- The topic ‘.htaccess – How to redirect to www. url?’ is closed to new replies.