2
   

mod_rewrite Not for phpBB

 
 
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,
  • Topic Stats
  • Top Replies
  • Link to this Topic
Type: Discussion • Score: 2 • Views: 1,615 • Replies: 7
No top replies

 
Craven de Kere
 
  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
 
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
 
Craven de Kere
 
  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
 
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
 
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
 
Craven de Kere
 
  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
 
Craven de Kere
 
  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

In How much time a website can be developed? - Question by aussiejumpingcastle
Webdevelopment and hosting - Question by harisit2005
Showing an Ico File - Discussion by Brandon9000
how to earn money in internet - Discussion by rizwanaraj
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
THANK YOU CRAVEN AND NICK!!! - Discussion by dagmaraka
I'm the developer - Discussion by Nick Ashley
 
  1. Forums
  2. » mod_rewrite Not for phpBB
Copyright © 2021 MadLab, LLC :: Terms of Service :: Privacy Policy :: Page generated in 0.03 seconds on 09/26/2021 at 04:50:14