nethnet Posted April 8, 2010 Share Posted April 8, 2010 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. Quote Link to comment https://forums.phpfreaks.com/topic/198049-what-am-i-doing-wrong/ Share on other sites More sharing options...
dreamwest Posted April 8, 2010 Share Posted April 8, 2010 I would use the simpliest form , then clean the $_GET in php app Options +FollowSymLinks RewriteEngine on RewriteRule ^user/(.*)/?$ user.php?name=$1 [L,QSA] Quote Link to comment https://forums.phpfreaks.com/topic/198049-what-am-i-doing-wrong/#findComment-1039187 Share on other sites More sharing options...
nethnet Posted April 8, 2010 Author Share Posted April 8, 2010 @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. Quote Link to comment https://forums.phpfreaks.com/topic/198049-what-am-i-doing-wrong/#findComment-1039190 Share on other sites More sharing options...
dreamwest Posted April 8, 2010 Share Posted April 8, 2010 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 Quote Link to comment https://forums.phpfreaks.com/topic/198049-what-am-i-doing-wrong/#findComment-1039196 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.