I want to convert the links(hyperlink) in my script to friendly-url using mod_rewrite, and I have the following example.
RewriteEngine On RewriteRule ^index/(.*)$ index.php?usr=$1 [L]
PHP, html Code:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <title></title> </head> <body> <?php echo $_GET['usr']; ?> <a href="index.php?usr=10">Click Here</a> </body> </html>
What I need is this code(hyperlink) when click on it.
<a href="index.php?usr=10">Click Here</a>
Link appears as follows in the address bar
domain.com/project/index/10 // `project` is the main folder of the script
But unfortunately, when I click on the previous link, appears in the address bar as follows
And now, what is the reason of appear the link as old form(without friendly-url) instead of appears as (friendly-url) ?