I have this line in my htaccess file:

RewriteCond %{HTTP_HOST} ^www.mysite.com$ [NC]

RewriteRule ^(.*)$ http://mysite.com/$1 [L,R=301]

And it works for the most part. But if you go to www.mysite.com/pagetitle, it redirects you to mysite.com/index.php?q=pagetitle. Why would it not redirect you to mysite.com/pagetitle? Is there another portion of code I need to insert into the htaccess file? I do already have search engine-friendly URLs enabled.

  • I'm wondering why you have not marked the answer as an accepted answer while it seems correct?
    – Yuseferi
    Commented Feb 17, 2020 at 20:28

1 Answer 1


Your RewriteConditions says if starting with www.mysite.com then redirect to http://mysite.com

This rule is not affecting clean urls. Clean urls must enabled at http://mysite.com/admin/settings/clean-urls

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.