View Full Version : How could I make links friendly?

02-29-2012, 10:48 AM
Hello! I want to make the links friendly, but I have some problems. I want to change www.mysite.com/index.php?page=motos in www.mysite.com/motos.html
In .htacces I have written:

Options +FollowSymlinks

RewriteEngine on

RewriteRule ^([a-z0-9_]+).html$ index.php?page=$1

but it's not enough.
I think that I make some changes in my php file, too. In my php file I have:


where $name could be motos or vehicles or...
How could I change href in my php file ? With preg_replace? Thank you very much!

03-01-2012, 05:02 AM
href="'.$name.'.html" ?

03-01-2012, 09:59 AM
Thank you for your message, I tried, but not working...

03-01-2012, 11:16 AM
I tried, but not working...
What's not working? The PHP side/ rewrite side ?

03-01-2012, 04:51 PM
I think that php side not working... It's for the first time when I try to work with htaccess and I haven't experience.

03-02-2012, 05:02 AM
I think that php side not working...
Make use of the "view source" option of your browser to check the output of that code.

EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum