Saturday, September 2, 2017

14.20 pm Rerouting all php requests through index.php

Here's what I use (and have used for ages):
 mod_rewrite.c>
    # Redirect /index.php to / (optional, but recommended I guess)
    RewriteCond %{THE_REQUEST} ^[A-Z]{3,9}\ /.*index\.php
    RewriteRule ^index.php/?(.*)$ $1 [R=301,L]

    # Run everything else but real files through index.php
    RewriteCond %{REQUEST_FILENAME} !-d
    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteRule ^(.*)$ index.php/$1?%{QUERY_STRING} [L]
As the comments suggest it will route every request that isn't an actual file to index.php

No comments:

Marques Mendes eleições 2026 corruption cases part 16 ( Ângelo Correia 1)

 https://www.publico.pt/2012/12/03/jornal/angelo-correia-e-marques-mendes-surpreendidos-por-terem-sido-fundadores-25688684