Go Back   CodingForums.com > :: Server side development > Apache configuration

Before you post, read our: Rules & Posting Guidelines

Reply
 
Thread Tools Rate Thread
Enjoy an ad free experience by logging in. Not a member yet? Register.
Old 09-14-2007, 04:07 PM   PM User | #1
webosb
New Coder

 
Join Date: Jun 2007
Posts: 28
Thanks: 2
Thanked 0 Times in 0 Posts
webosb is an unknown quantity at this point
any htaccess gurus out there?

I'm having trouble making my page pick up $_GET vars. I'm thinking it is the .htaccess file causing this.... I'm trying to make it be able to pick up if def=1 or not... i.e. http://www.foo.com/?def=1

right now, my htaccess looks like this:

RewriteEngine on
RewriteRule ^([A-Z0-9]{6})/?$ main.php?rid=$1&cid=8 [L]
RewriteRule ^user/([A-Z0-9]{6})/?$ user.php?uid=$1&cid=8 [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^(.*)$ main.php?cid=8

my index.php looks like this:

if (isset($_GET['def'])){
header("Location: main.php?cid=8&def=1");
}else{
header("Location: main.php?cid=8");
}

anyway i can get $_GET['def'] to be picked up? thanks in advance.
webosb is offline   Reply With Quote
Old 09-14-2007, 04:14 PM   PM User | #2
nikkiH
Senior Coder

 
nikkiH's Avatar
 
Join Date: Jun 2005
Location: Near Chicago, IL, USA
Posts: 1,973
Thanks: 1
Thanked 32 Times in 31 Posts
nikkiH is on a distinguished road
That's part of the query string and needs special syntax.
http://www.webmasterworld.com/forum92/664.htm
__________________

If this post contains any code, I may or may not have tested it. It's probably just example code, so no getting knickers in a bunch over a typo, OK? If it doesn't have basic error checking in it, such as object detection or checking if objects are null before using them, put that in there. I'm giving examples, not typing up your whole app for you. You run code at your own risk.
Bored? Visit
http://www.kaelisspace.com/
nikkiH is offline   Reply With Quote
Old 09-14-2007, 05:00 PM   PM User | #3
webosb
New Coder

 
Join Date: Jun 2007
Posts: 28
Thanks: 2
Thanked 0 Times in 0 Posts
webosb is an unknown quantity at this point
ah yes. that link was SO HELPFUL! I love this forum. you guys are awesome. Thanks nikkiH!
webosb is offline   Reply With Quote
Old 09-14-2007, 07:16 PM   PM User | #4
nikkiH
Senior Coder

 
nikkiH's Avatar
 
Join Date: Jun 2005
Location: Near Chicago, IL, USA
Posts: 1,973
Thanks: 1
Thanked 32 Times in 31 Posts
nikkiH is on a distinguished road
You're welcome
__________________

If this post contains any code, I may or may not have tested it. It's probably just example code, so no getting knickers in a bunch over a typo, OK? If it doesn't have basic error checking in it, such as object detection or checking if objects are null before using them, put that in there. I'm giving examples, not typing up your whole app for you. You run code at your own risk.
Bored? Visit
http://www.kaelisspace.com/
nikkiH is offline   Reply With Quote
Reply

Bookmarks

Jump To Top of Thread


Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +1. The time now is 05:49 PM.


Advertisement
Log in to turn off these ads.