开发者

.htAccess REdirect without 302

开发者 https://www.devze.com 2023-01-20 10:57 出处:网络
I have the following .htaccess: RewriteEngine on RewriteBase / RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{REQUEST_FILENAME} !-d

I have the following .htaccess:

RewriteEngine on
RewriteBase /

RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
rewriterule .* LoadSite.php

What I am trying to do is that if the file doesn't exist then call LoadSite.php... this will then load any number of other php files via include (dependi开发者_开发技巧ng on the url).... this works for a GET request, but when the a POST is made, I does a 302 redirect and therefore the script doesn't get the POST variables. Any ideas would be appreciated


Tested and works:

.htaccess:

<IfModule mod_rewrite.c>
   RewriteEngine On
   RewriteBase /
   RewriteCond %{REQUEST_FILENAME} !-f
   RewriteCond %{REQUEST_FILENAME} !-d
   RewriteRule (.*) /err.php?reason=404
</IfModule>
0

精彩评论

暂无评论...
验证码 换一张
取 消