Shinyshell Community Forums > Coding > Probably Just a Silly Mistake |
||||||
Sign Up | Member List | New Posts | Help |
[1]
August 01 02009, 15:42 GMT | ||||
Peter* A Pythonic One Location: US Post count: 99 |
I'm trying to GET some information from the URL using $_GET. I implemented .htaccess today and it won't work. I'm using page includes.
.htaccess: RewriteEngine on #Make it so that /index.php?id=x is /x (x = string) RewriteRule ^([A-Za-z0-9_-]+)$ index.php?id=$1 PHP pageInclude() function: <?php PHP GET statement: <?php The page concerned is the Profile page, /profile or index.php?id=profile. I want to be able to say /profile?user=Name, as opposed to index.php?id=profile&user=Name. |
August 02 02009, 17:41 GMT | ||||
lec** Supra stultitiam Location: Varaždin, Croatia Post count: 173 |
Ah, I don't think you can actually do that. I mean, supply querystrings to urls that have been overwritten - /profile is overwritten to index.php?id=profile, so /profile?user=Name would be overwritten to index.php?id=profile?user=Name (two querystrings) which doesn't work.
Moreover, your regex won't match the "?" at all. It's probably best to overwrite the urls for the profile page separately, so you have something like /profile/Name instead of profile?user=Name. |
August 02 02009, 22:21 GMT | ||||
Peter* A Pythonic One Location: US Post count: 99 |
How exactly would I do so? :D
|
August 03 02009, 01:07 GMT | ||||
lec** Supra stultitiam Location: Varaždin, Croatia Post count: 173 |
RewriteRule ^profile/([A-Za-z0-9_-]+)/? index.php?id=profile&user=$1 |
[1]
Forum Information |
||||||||||
|