Rerouting all php requests through index.php

前端 未结 4 1758
误落风尘
误落风尘 2020-11-28 07:20

How can I reroute all requests for php pages through index.php?

My .htaccess is as follows:

Options +FollowSymLinks
IndexIgnore */*
#Turn on the Rewr         


        
4条回答
  •  暖寄归人
    2020-11-28 08:00

    RewriteEngine On
    RewriteCond %{REQUEST_FILENAME} !index\.php$
    RewriteRule .*\.php$ index.php?q=%{REQUEST_URI} [L]
    

    Will catch all requests ending in .php that don't point to a file ending in index.php and redirect them to index.php in the get parameter q

提交回复
热议问题