Mobile app version of vmapp.org
Login or Join
Eichhorn148

: Force url to use www I'm confused about how to force my url to use www in the address. I have a .htaccess code like this: <IfModule mod_rewrite.c> RewriteEngine On RewriteBase / RewriteCond

@Eichhorn148

Posted in: #Apache #Htaccess #NoWww #Url #UrlRewriting

I'm confused about how to force my url to use www in the address.

I have a .htaccess code like this:

<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /index.php [L]
</IfModule>


I'm changing

RewriteRule . /index.php [L]


with

RewriteRule (.*) www.mysite.com/ [R=301,L]


but I still get an error.

The page isn't redirecting properly when I open www.mysite.com/category

10.01% popularity Vote Up Vote Down


Login to follow query

More posts by @Eichhorn148

1 Comments

Sorted by latest first Latest Oldest Best

 

@XinRu657

Your .htaccess looks like you are using Wordpress. Is this true? If that is the case, just go to Settings -> General and change WordPress Address (URL) and Site Address (URL) to versions with 'www'.

10% popularity Vote Up Vote Down


Back to top | Use Dark Theme