Jump to content

Recommended Posts

I feel like this is a really simple problem...  I'm working with mod_rewrite and I've done so for years, and never had a problem.  But all of a sudden on this new server, I'm having a problem getting the $_GET array to contain.. well, anything.  Everytime a page is redirected, the $_GET array is empty.

 

RewriteEngine on
RewriteRule ^user/([a-zA-Z0-9]+)/?$ user.php?name=$1

 

The page is actually redirected to user.php without any problem, but when I try to pull out the $_GET['name'] data, it is empty, everytime.

 

Am I doing something incredibly stupid?  I'm hoping so...  I really don't want to have to configure Apache or anything...

 

Thanks in advance.

Link to comment
https://forums.phpfreaks.com/topic/198049-what-am-i-doing-wrong/
Share on other sites

@dreamwest,

 

Thanks for the response.  Unfortunately, the $_GET array is still coming up empty when /user/testuser is accessed.  So my fears are true... it's not an issue with REGEX errors or anything.  Something is going fishy with Apache itself.

 

Any other input is appreciated...  I have no idea where to begin with fixing this.

The rewrite looks ok, try removing the query and adding a second rewrite, if that doesnt work its nor your code

 

Options +FollowSymLinks
RewriteEngine on

RewriteRule ^user/(.*)/(.*) user.php?name=$1 [L,QSA]

 

and make sure url rewrite is on in your sever panel

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.