Click here to Skip to main content
14,971,029 members
Please Sign up or sign in to vote.
4.00/5 (1 vote)
See more:
Hi people,

I'm fairly new to php and I would like to know how to rewrite a static url to a friendly url.

E.g. Rewrite:

- http://site.domain.com/buy_products.html
to
- http://site.domain.com/buy-products

or

/index.html
to
/home

I tried this and did not work:

VB
Options +FollowSymlinks
RewriteEngine On
RewriteBase /
RewriteRule ^home index.html
RewriteRule ^wine-range wine_range.html



I will appreciate your help. I've googled and the examples I come across are mostly converting dynamic urls to static.

Regards,
Morgs
Posted

1 solution

Check if .htaccess can be used on your server.
   

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)




CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900