remove index.php from zend framework url

前端 未结 2 806
小蘑菇
小蘑菇 2021-01-16 01:46

I am developing a module using zend framework and I have created a project using zf create project command

when i try to access the url using ip/folder/control

相关标签:
2条回答
  • 2021-01-16 02:27

    Try adding this to your .htaccess:

    RewriteCond %{THE_REQUEST} ^[A-Z]{3,9} /([^/]+/)*index.php 
    RewriteRule ^index.php(.*)$ /path/to/your/installation$1 [R=301,L]
    

    Replace /path/to/your/installation with the correct path

    0 讨论(0)
  • 2021-01-16 02:34

    I just add this to the top of the index.php:

    $_SERVER["REQUEST_URI"] = str_replace('index.php', '', $_SERVER["REQUEST_URI"]);
    

    which is the other method suggested by Rob Allen at Akrabat.com

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