|
Home > Archive > Apache Server configuration support > August 2005 > Help with rewrite
You are viewing an archived Text-only version of the thread.
To view this thread in it's original format and/or if you want to reply to
this thread please [click here]
|
|
| Michael Satterwhite 2005-08-28, 5:52 pm |
| I have two pages:
category.php?id=123
subcategory.php?id=456
I want to normalize them to cat123.html and subcat456.html (This isn't
carved in stone; if you can think of a better rewrite scheme, I'm open to
suggestions)
I've put the following into .htaccess:
RewriteEngine on
RewriteRule ^/cat(.+)\.html$ /category.php?id=$1
RewriteRule ^/subcat(.+)\.html$ /subcategory.php?id=$1
Would someone be so kind as to point out what I'm missing?
Thanks in advance
---Michael
| |
| Gabriel Reid 2005-08-28, 5:52 pm |
| Michael Satterwhite wrote:
> I have two pages:
> category.php?id=123
> subcategory.php?id=456
>
> I want to normalize them to cat123.html and subcat456.html (This isn't
> carved in stone; if you can think of a better rewrite scheme, I'm open to
> suggestions)
>
> I've put the following into .htaccess:
>
> RewriteEngine on
> RewriteRule ^/cat(.+)\.html$ /category.php?id=$1
> RewriteRule ^/subcat(.+)\.html$ /subcategory.php?id=$1
>
> Would someone be so kind as to point out what I'm missing?
It would be a lot easier to provide assistance if you would say what is
going wrong (i.e. what are you getting when you request the page, and
how does it differ from what you were expecting).
Your rewrite rules look okay to me, although I'd use "\d+" instead of
".+" for matching the id, assuming ids are always numeric.
Gabriel
| |
|
|
|
|
|