Reply
Tue 20 Jul, 2004 08:14 am
I have a web site that uses php to call pages form the database the we it works when calling new pages is www domain com?category=761c49&parent=0&page=1 there is an index.php which you can call However, when you use link you get the above the only part that changes is the = 761c49 unless there is more that one page in that category. From the category the links lead to product information? www domain.com?product=ecbf6a&category=761c49&parent=0
Is there a way of using mod_rewrite to change it to something like 761c49.html
If you need to look at the site which is not finished yet
www
apoco-music-shop
co.uk
Thanks
Barrie,
Here's the code:
Code:RewriteEngine On
RewriteRule page-([0-9]*).html index.php?product=ecbf6a&category=$1&parent=0[L,NC]
Then just point the links to page-XXXXX.html
Thanks but
product=ecbf6a&category=$1&parent=0[L,NC]
^^^^^
This will difrent for each product should it not be like the
category one
Barrie,
Then use this:
RewriteEngine On
RewriteRule p-(.*)-(.*).html index.php?$1=ecbf6a&category=$2&parent=0[L,NC]
And link like this p-PRODUCT-NUMBER.html
I have noticed this part of the rewrite
"RewriteRule page-([0-9]*).html "
this means that the max no. is 10?
If I have like 40 forums, do I just have [0-39] instead?
Craven de Kere wrote:Then use this:
RewriteEngine On
RewriteRule p-(.*)-(.*).html index.php?$1=ecbf6a&category=$2&parent=0[L,NC]
And link like this p-PRODUCT-NUMBER.html
The problem is that the site dynamically generates the menu links just like phpbb so it may be a bit more complex than a simple RewriteRule
Thanks for your time
Barrie,
streak1 wrote:I have noticed this part of the rewrite
"RewriteRule page-([0-9]*).html "
this means that the max no. is 10?
No, it means a string with any combination of numbers from 0-9.
Quote:If I have like 40 forums, do I just have [0-39] instead?
No, that would completely break it.
forte wrote:
The problem is that the site dynamically generates the menu links just like phpbb so it may be a bit more complex than a simple RewriteRule
The rewrite is to make the URLs work, not to generate them. You'll need to modify your software to link to the static URLs.
Not knowing what software it is, I can't tell you how to do it (and even if I knew what software it is, I probably will not have time to download and learn the code).