Expression Engine - Removing index.php completely

前端 未结 1 722
清歌不尽
清歌不尽 2021-01-14 20:48

I\'ve been using the below code in my .htaccess file for a while to make the EE URLs work without needing index.php in the URL. What I\'ve found though it that I\'m getting

相关标签:
1条回答
  • 2021-01-14 21:01

    Sure thing.

    # Enable Rewrite Engine
    # ------------------------------
    RewriteEngine On
    RewriteBase /
    
    # Redirect index.php Requests
    # ------------------------------
    RewriteCond %{THE_REQUEST} ^[^/]*/index\.php [NC]
    RewriteCond %{THE_REQUEST} ^GET
    RewriteRule ^index\.php(.+) $1 [R=301,L] 
    
    # Standard ExpressionEngine Rewrite
    # ------------------------------
    RewriteCond $1 !\.(css|js|gif|jpe?g|png) [NC]
    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteCond %{REQUEST_FILENAME} !-d
    RewriteRule ^(.*)$ /index.php/$1 [L] 
    
    0 讨论(0)
提交回复
热议问题