2
   

mod_rewrite Not for phpBB

 
 
Post: # 799,159
View Profile forte
 
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,
 
  1  
Reply Tue 20 Jul, 2004 08:57 am
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
0 Replies
 
Post: # 799,301
View Profile forte
 
  1  
Reply Tue 20 Jul, 2004 09:42 am
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,
0 Replies
 
  1  
Reply Tue 20 Jul, 2004 10:52 am
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
0 Replies
 
Post: # 801,087
View Profile streak1
 
  1  
Reply Wed 21 Jul, 2004 09:41 am
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?
0 Replies
 
Post: # 801,282
View Profile forte
 
  1  
Reply Wed 21 Jul, 2004 11:09 am
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,
0 Replies
 
  1  
Reply Wed 21 Jul, 2004 11:39 am
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.
0 Replies
 
  1  
Reply Wed 21 Jul, 2004 11:43 am
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).
0 Replies
 
 

Related Topics

I'm the developer - Discussion by Nick Ashley
how to earn money in internet - Discussion by rizwanaraj
THANK YOU CRAVEN AND NICK!!! - Discussion by dagmaraka
The version 10 bug. Worse then Y2K! - Discussion by Nick Ashley
CSS Border style colors - Question by meesa
There is no Wisdom in Crowds - Discussion by ebrown p
mod rewrite for a different theme? - Discussion by etali
 
  1. able2know
  2. » mod_rewrite Not for phpBB
Copyright © 2009 Horizontal Verticals :: Page generated in 0.35 seconds on 11/23/2009 at 05:05:35 Top End