简体   繁体   中英

.htAccess REdirect without 302

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 (depending 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>

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM