Expand|Select|Wrap|Line Numbers
- www.mysite.com/template.php?id=pagetitle
- www.mysite.com/template.php?id=folder/pagetitle
I want the URLs to look like:
Expand|Select|Wrap|Line Numbers
- www.mysite.com/pagetitle
- www.mysite.com/folder/pagetitle
How do I write this RewriteRule into my .htaccess file? Or, is there a better way.
I originally wrote a separate rule for every single URL, but, as you could imagine, the performance of the site took a huge hit. (see example below).
Expand|Select|Wrap|Line Numbers
- RewriteEngine On
- RewriteRule ^$ http://www.mysite.com/template.php?id=home
- RewriteRule ^(about/history/|about/history)$ template.php?id=about/history
- RewriteRule ^(services/|services)$ template.php?id=services
- RewriteRule ^(contact/|contact)$ template.php?p=contact
- etc., etc., etc.
Also, I'm a newbie to code -- design's my gig -- so directing me to the Apache docs will not help me much, unfortunately (as it's Greek to me).
Perhaps an example, or citing an article with examples would help me.
Thank you very much.
Brad