Forum Moderators: coopster
I currently make websites so that every section is included into my index.php via an id number,
e.g. the URL often ends up www.someurl.co.uk/index.php?id=491
I am wanting to do a more user friendly URL approach. For example, I want to give the impression of a structured website using folders etc, but they will be the same page just with different content, e.g.
www.someurl.co.uk/page1/
www.someurl.co.uk/page7/subpage53/
What is the best way to do this without putting my website files within EVERY folder, or is there a way to achieve this without making the folders at all?
Thank you.
Options +FollowSymLinks
RewriteEngine on
RewriteOptions inherit
RewriteRule ^([^/]+)/([^/]+)/([^-]+)-([^-]+)\.htm$ my_page.php?var1=$1&var2=$2&var3=$3&var4=$4 [NC,L]
The above pattern will lead you from [mysite.com...] form to something like [mysite.com...]
For more info on using htaccess mod_rewrite check [webmasterworld.com...]