Mod_rewrite: yakalamak nasıl php dosyaları.?

0 Cevap php

I'm trying to catch all .php requests so that my visitors won't be able to see the php magic

I example.com/home example.com/index.php yönlendirilmek, ama ben example.com/index.php doğrudan erişim istemiyorum istiyorum

RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ index.php/$1 [L]

Ilk bakışta çalışmak gibi görünüyor olsa da, it doesn't prevent users from visiting example.com/index.php directly.

How would I solve this?


Bir cevap cevap olarak:

RewriteRule ^index.php$ / [R=301,L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ index.php/$1 [L]

RewriteRule ^home/?$ /index.php?category=1 [L]

example.com/home çıkışları example.com/category=1

0 Cevap