Rerouting all php requests through index.php

前端 未结 4 1763
误落风尘
误落风尘 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 07:36

    To redirect all non-existent requests to /index.php , You can also use ErrorDocument and FallbackResource directives .

    Try one of the following examples :

     ErrorDocument 404 /index.php
    
    
     FallbackResource /index.php
    

    These directives are part of apache core modules and you dont need to enable mod-rewrite to use them.

    If you are looking for a way to redirect all requests (including real files/dirs) then try the following Redirect

    RedirectMatch ^/(?!index\.php).+)$ /index.php
    

提交回复
热议问题