ExpressionEngine CMS
Open, Free, Amazing

Thread

This is an archived forum and the content is probably no longer relevant, but is provided here for posterity.

The active forums are here.

Using htaccess to remove both index.php AND non-www requests

February 16, 2012 12:36pm

Subscribe [2]
  • #1 / Feb 16, 2012 12:36pm

    Argyll

    67 posts

    Is it possible? I’m currently using the EE-approved htaccess code and it works fine for removing index.php. But I’d also like to direct non-www request to the www version. I made a modification to this code without success.

  • #2 / Feb 16, 2012 10:03pm

    Bhashkar Yadav

    727 posts

    RewriteCond %{HTTP_HOST} !^www(.*)
    RewriteRule ^(.*) <a href="http://www.%{http_host}%{request_uri}">http://www.%{http_host}%{request_uri}</a> [R]

    add these lines into your htaccess file.

  • #3 / Feb 20, 2012 9:32am

    Argyll

    67 posts

    Above or below the EE code that removes “index.php?”

  • #4 / Feb 20, 2012 12:23pm

    Bhashkar Yadav

    727 posts

    well, please put it below ....

.(JavaScript must be enabled to view this email address)

ExpressionEngine News!

#eecms, #events, #releases