|
|
|
#1 |
|
Messages: n/a
Hébergeur: |
I have the current rewrite rule:
RewriteRule foo/(.*)/(.*)/(.*)/(.*)/$ /foo/index.php?$1=$2&$3=$4 I'd like to be able to have an additional - but optional - parameter at the end, for pagination. TIA for any . Karl |
|
|
|
#2 |
|
Messages: n/a
Hébergeur: |
KarlCore <karl@karlcore.com> wrote:
> I have the current rewrite rule: > > RewriteRule foo/(.*)/(.*)/(.*)/(.*)/$ /foo/index.php?$1=$2&$3=$4 > > I'd like to be able to have an additional - but optional - parameter > at the end, for pagination. The easiest might be to make an additional rule, e.g.: RewriteRule foo/(.*)/(.*)/(.*)/(.*)/(\d+)$ /foo/index.php?$1=$2&$3=$4&page=$5 (split over 2 lines) -- John Bokma http://johnbokma.com/ |
|
|
|
#3 |
|
Messages: n/a
Hébergeur: |
On Dec 23, 11:55 am, John Bokma <j...@castleamber.com> wrote:
> KarlCore <k...@karlcore.com> wrote: > > I have the current rewrite rule: > > > RewriteRule foo/(.*)/(.*)/(.*)/(.*)/$ /foo/index.php?$1=$2&$3=$4 > > > I'd like to be able to have an additional - but optional - parameter > > at the end, for pagination. > > The easiest might be to make an additional rule, e.g.: > > RewriteRule foo/(.*)/(.*)/(.*)/(.*)/(\d+)$ > /foo/index.php?$1=$2&$3=$4&page=$5 > > (split over 2 lines) Just to be clear, your proposed solution is to keep the original rule and add this one as well? Karl |
|
|
|
#4 |
|
Messages: n/a
Hébergeur: |
KarlCore <karl@karlcore.com> wrote:
> On Dec 23, 11:55 am, John Bokma <j...@castleamber.com> wrote: >> KarlCore <k...@karlcore.com> wrote: >> > I have the current rewrite rule: >> >> > RewriteRule foo/(.*)/(.*)/(.*)/(.*)/$ /foo/index.php?$1=$2&$3=$4 >> >> > I'd like to be able to have an additional - but optional - parameter >> > at the end, for pagination. >> >> The easiest might be to make an additional rule, e.g.: >> >> RewriteRule foo/(.*)/(.*)/(.*)/(.*)/(\d+)$ >> /foo/index.php?$1=$2&$3=$4&page=$5 >> >> (split over 2 lines) > > Just to be clear, your proposed solution is to keep the original rule > and add this one as well? Yes You can make one rule, but then your index.php has to be able to handle the case that page can be empty (e.g. page=). I.e. change the original rule into: RewriteRule foo/(.*)/(.*)/(.*)/(.*)/(\d*)$ /foo/index.php?$1=$2&$3=$4&page=$5 And don't add the one I gave earlier. BTW: I would replace each .* with .+ because now RewriteRule foo/////$ Also calls your index.php. I am not sure if it can handle that one, moreover, do you want URLs like that one to be possible. -- John Bokma http://johnbokma.com/ |
|
![]() |
| Outils de la discussion | |
|
|