Jump to content

creating dynamic url using RewriteRule


zenag

Recommended Posts

i need help in creating dynamic url using  .htacces

i need

http://demo.hypercube.com/zenag

to be redirected to page...

http://demo.hypercube.com/manage/user.php?username=zenag

 

i ve used

RewriteEngine On

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

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

 

it shows 404 error ,but works pretty well  in my localhost..any help pls...

Link to comment
https://forums.phpfreaks.com/topic/157332-creating-dynamic-url-using-rewriterule/
Share on other sites

Where did you put your .htaccess ?

 

You may need to change your rules to that :

RewriteRule ^([a-zA-Z0-9_-]+)$ /manage/user.php?username=$1

 

And put your .htaccess in / instead or /manage

 

Or move the user.php to / instead or /manage

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.