Codeigniter URL not working without index.php

后端 未结 3 1142
没有蜡笔的小新
没有蜡笔的小新 2021-01-20 01:03

I\'ve just set up a new webiste http://www.reviewongadgets.com

But there is a problem with URL rendering

When I put an URL as below it\'s not working and giv

相关标签:
3条回答
  • 2021-01-20 01:36

    You might not have rewrite_module module loaded. Try running below command.

    sudo a2enmod rewrite
    
    0 讨论(0)
  • 2021-01-20 01:50

    i aggree with Vlakarados, but i will share my .htaccess setting

    RewriteEngine on
    RewriteCond $1 !^(index\.php|images|css|js|robots\.txt|favicon\.ico)
    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteCond %{REQUEST_FILENAME} !-d
    RewriteRule ^(.*)$ ./index.php?/$1 [L,QSA]
    

    its work perfectly.

    i hope that's work to for your CI website

    0 讨论(0)
  • 2021-01-20 02:00

    The most common solution to this problem is usually the missing question mark ? after index.php in .htaccess, so

    RewriteRule ^(.*)$ index.php/$1 [L]
    

    should be

    RewriteRule ^(.*)$ index.php?/$1 [L]
    

    E.G. on my Windows XAMPP, I do not need the "?", but in a Linux hosting environment it is usually required.

    0 讨论(0)
提交回复
热议问题