Remove “index.php” from URL - Codeigniter

前端 未结 12 1179
清酒与你
清酒与你 2020-12-03 16:05

I\'ve looked in the documentation of Codeigniter of removing the index.php from the URL when accessing different views, the code shows how to remove it with apa

12条回答
  •  抹茶落季
    2020-12-03 16:31

    Try this one

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

    I tried 3 before I got one to work

提交回复
热议问题