ISAPI ZEND url rewrite adding extra “/index.php/” into url

早过忘川 提交于 2020-01-15 03:53:20

问题


We recently reinstalled our web site on our server, the sys admin says it is an exact rebuild, and it indeed looks to me that it is, but there is something different going on. I did not originally develop the site, and those who did are no longer available.

urls for the admin site are now

//admin.site.com/index.php/schedules

and used to be, and should be

//admin.site.com/schedules

The extra index.php is getting inserted in the url. But all links within the admin site do not include the index.php so they do not work. If you insert the index.php into any url, it works. Where did this index.php come from and how do I eliminate it from the rewrite rules so the links will work.

This is what my httpd.conf file reads:

# Helicon ISAPI_Rewrite configuration file
# Version 3.1.0.56

# turn on rewriting RewriteEngine On RewriteBase /

# for all files not found in the file system,
# reroute to "index.php" bootstrap script,
# keeping the query string intact. 
RewriteCond %{HTTP_HOST} ^admin.site.com$ 
RewriteCond %{REQUEST_FILENAME} -s [OR]
RewriteCond %{REQUEST_FILENAME} -l [OR] 
RewriteCond %{REQUEST_FILENAME} -d 
RewriteRule ^.*$ - [NC,L] 
RewriteCond %{HTTP_HOST} ^admin.site.com$ 
RewriteRule ^.*$ index.php [NC,L]

Thank you! Any help would be greatly appreciated.


回答1:


You need to implement and enable ApacheModrewrite. And then put a .htaccess file in your admin.site.com folder Its content will be :

RewriteEngine On
RewriteCond %{REQUEST_FILENAME} -s [OR] 
RewriteCond %{REQUEST_FILENAME} -l [OR]
RewriteCond %{REQUEST_FILENAME} -d


RewriteRule ^.*$ - [NC,L]
RewriteRule ^.*$ index.php [NC,L]


来源:https://stackoverflow.com/questions/1463152/isapi-zend-url-rewrite-adding-extra-index-php-into-url

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!