How Do I make a simple .htaccess internal redirect Catch All script while forwarding POST data?
- by RB
I just want to catch all requests and forward them internally to my catchall page with all POST data intact
Catch all page:
http://www.mydomain.com/addons/redirect/catch-all.php
I've tried so many combinations, but my server doesn't want to redirect internally if I specify more than catch-all.php
# Internally redirect all pages to "Catch" page
Options +FollowSymLinks
RewriteEngine on
RewriteRule (.*) /addons/redirect/catch-all.php [L]
Also, do I need [L] or is it useless for internal redirects?
Then, what php code would I use to grab the POST data, use it, and finally PHP redirect the page to the originally requested page
Would it be done just as normal by using $_POST['variable_name']; or something different?
Then, how would I go about calling the originally requested page, so I can tell PHP to header location direct them to that page?
Thanks!
UPDATE:
Ha sick, nevermind. The condition DOES work. Here's my code:
# Internally redirect all pages to "Catch" page
Options +FollowSymLinks
RewriteEngine on
RewriteCond %{REQUEST_URI} !^/robots.txt$
RewriteCond %{REQUEST_URI} !\.(gif¦jpe?g¦png¦css¦js¦pdf¦doc¦xml)$
RewriteCond %{REQUEST_URI} !^/addons/redirect/catch-all\.php$
RewriteRule (.*)$ /addons/redirect/catch-all.php?q=$1 [L]
Thanks guys for the inspiration!
Now time to get that PHP to work...