We use cookies to improve your experience. No personal information is gathered and we don't serve ads. Cookies Policy.

ExpressionEngine Logo ExpressionEngine
Features Pricing Support Find A Developer
Partners Upgrades
Blog Add-Ons Learn
Docs Forums University
Log In or Sign Up
Log In Sign Up
ExpressionEngine Logo
Features Pro new Support Find A Developer
Partners Upgrades
Blog Add-Ons Learn
Docs Forums University Blog
  • Home
  • Forums

Problem removing index.php from URLs

How Do I?

Mike K's avatar
Mike K
5 posts
4 years ago
Mike K's avatar Mike K

Hi, I ‘m in the middle of transferring a 1.x site to 5.3 (upgrading was just a futile nightmare I wouldn’t wish on anyone).

I’ve followed directions in the documentation to add rewrite rules to remove index.php from URLs. And believe I copied relevant httpd.conf directives from the 1.x httpd.conf which works fine.

But now, although all my non-root urls work fine without index.php, trying to hit / or /index.php (my site entry page) gives me access denied errors. Directories and files are all 775/664 permissions.

My .htaccess:

<IfModule mod_rewrite.c>
    RewriteEngine On
    RewriteBase /

    # Removes index.php from ExpressionEngine URLs
    RewriteCond %{THE_REQUEST} ^GET.*index\.php [NC]
    RewriteCond %{REQUEST_URI} !/system/.* [NC]
    RewriteRule (.*?)index\.php/*(.*) /$1$2 [R=301,NE,L]

    # Directs all EE web requests through the site index file
    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteCond %{REQUEST_FILENAME} !-d
    RewriteRule (.*) /index.php/$1 [L]
</IfModule>

These should be the relevant portions of my httpd.conf:

AcceptPathInfo On
 
 ServerName 127.0.0.1
 DocumentRoot /var/www/vhosts/eesite/htdocs
 #
 # Relax access to content within docroot parent
 #
 <Directory "/var/www/vhosts/eesite">
     AllowOverride None
     # Allow open access:
     Require all granted
 </Directory>

 # Further relax access to the default document root:
 <Directory "/var/www/vhosts/eesite/htdocs">
   Options Indexes FollowSymLinks
   AllowOverride All
   Require all granted
 </Directory>

Does anyone have any ideas?
Thanks, Mike

       

Reply

Sign In To Reply

ExpressionEngine Home Features Pro Contact Version Support
Learn Docs University Forums
Resources Support Add-Ons Partners Blog
Privacy Terms Trademark Use License

Packet Tide owns and develops ExpressionEngine. © Packet Tide, All Rights Reserved.