.htaccess and Request vars

Need help installing PHP, configuring a script, or configuring a server? Then come on in and post your questions! We'll try to help the best we can!

Moderator: General Moderators

Post Reply
phpCCore Brad
Forum Commoner
Posts: 47
Joined: Sun Dec 04, 2005 5:46 pm
Location: Michigan, USA
Contact:

.htaccess and Request vars

Post by phpCCore Brad »

Okay first off I have a .htaccess file with the following:

Code: Select all

ErrorDocument 404 /index.php?pageLoader=true
Which redirects the users to a php document. The problem I am having is how can I transfer $_REQUEST vars to the php document? Or is this not possible?


Thanks,
Brad Bridges
User avatar
Christopher
Site Administrator
Posts: 13596
Joined: Wed Aug 25, 2004 7:54 pm
Location: New York, NY, US

Post by Christopher »

The value for that request will be in $_REQUEST['pageLoader'].
(#10850)
phpCCore Brad
Forum Commoner
Posts: 47
Joined: Sun Dec 04, 2005 5:46 pm
Location: Michigan, USA
Contact:

Update

Post by phpCCore Brad »

Sorry if I didn't explain well. I was trying to find a way to transfer the request vars (post get etc) to the php document. I ended up chaning it to a rewrite rule:

Code: Select all

RewriteEngine on
RewriteRule ^([A-Za-z0-9-]+)/?$ /index.php?pageLoader=true&cmd=$1

The only problem with this is that it doesn't accept _ in the URL and I don't know practically anything about patterns, so I don't know how to change it.

Any help woul be greatly appreciated!

Thanks,
Brad Bridges
timvw
DevNet Master
Posts: 4897
Joined: Mon Jan 19, 2004 11:11 pm
Location: Leuven, Belgium

Post by timvw »

Assuming you actually want to learn about regular expressions: viewtopic.php?t=33147...
Post Reply