Jump to content

need help understanding mod_rewrite


doddsey_65

Recommended Posts

okay i have a htaccess file which reqrites

profile.php?username=username

to

profile/username/username.html

 

Do i now need my href links to point to the second url instead of the dynamic one?

I have done this and it loads the page profile/usewrname/username.html but the information

i am supposed to get from $_GET['username'] doesnt show up and its just a blank section.

 

 

Link to comment
https://forums.phpfreaks.com/topic/204614-need-help-understanding-mod_rewrite/
Share on other sites

This is a common misconception. I highly doubt you have re-written from profile.php?username=username to profile/username/username.html, you are infact doing the opposite, which means, yes, you should be chaning all hrefs to point at profile/username/username.html rather than the alternative. If the $_GET['username'] is empty try print_r($_GET), just incase you spelt something wrong, if that doesn't work then you will have to show us what your current rewrite rules are.

Archived

This topic is now archived and is closed to further replies.

×
×
  • 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.