logo
Apache Lounge
Webmasters

 

About Forum Index Downloads Search Register Log in RSS X


Keep Server Online

If you find the Apache Lounge, the downloads and overall help useful, please express your satisfaction with a donation.

or

Bitcoin

A donation makes a contribution towards the costs, the time and effort that's going in this site and building.

Thank You! Steffen

Your donations will help to keep this site alive and well, and continuing building binaries. Apache Lounge is not sponsored.
Post new topic   Forum Index -> Other Software View previous topic :: View next topic
Reply to topic   Topic: Apache 1.3 rewrite?
Author
Jorge



Joined: 12 Mar 2006
Posts: 376
Location: Belgium

PostPosted: Tue 17 Jul '07 10:17    Post subject: Apache 1.3 rewrite? Reply with quote

well I have these nice rules that work fine on 2.0 and 2.2

Code:
RewriteEngine On
RewriteRule ^/go/([^/]*)/([^/]*)/([^/]*)/([^/]*)/([^/]*) /index.php?pageid=$1&$2=$3&$4=$5 [PT]
RewriteRule ^/go/([^/]*)/([^/]*)/([^/]*) /index.php?pageid=$1&$2=$3 [PT]
RewriteRule ^/go/([^/]*) /index.php?pageid=$1 [PT]


they don't work at all under 1.3 after hours of tweaking I still have nothing all I got sofar was I could only get one rule to work at a time and all images,css files,... where broke.
ANy ideas?
Back to top
James Blond
Moderator


Joined: 19 Jan 2006
Posts: 7371
Location: Germany, Next to Hamburg

PostPosted: Tue 17 Jul '07 11:22    Post subject: Reply with quote

Not sure about that, but the 1.3 docs showed a bit different syntax to yours.

Code:

RewriteRule   ^/([uge])/([^/]+)(/?.*)/\*  /index.php?i=/$1/$2$3/


Found here search for New MIME-type, New Service

Maybe that helps you.

If not you can ask the experts: forum.modrewrite.com
Back to top
Jorge



Joined: 12 Mar 2006
Posts: 376
Location: Belgium

PostPosted: Tue 17 Jul '07 15:34    Post subject: Reply with quote

figured it out... 2.x seems to redirect sub requests correctly while 1.3 doesn't.

It was fixed with more rules:

Code:

RewriteEngine On
#rewrite index.php
RewriteRule ^go/([^/]*)/([^/]*)/([^/]*)/([^/]*)/([^/]*)/([^/]*)/([^/]*)/$ index.php?pageid=$1&$2=$3&$4=$5&$6=$7 [PT]
RewriteRule ^go/([^/]*)/([^/]*)/([^/]*)/([^/]*)/([^/]*)/$ index.php?pageid=$1&$2=$3&$4=$5 [PT]
RewriteRule ^go/([^/]*)/([^/]*)/([^/]*)/$ index.php?pageid=$1&$2=$3 [PT]
RewriteRule ^go/([^/]*)/$ index.php?pageid=$1 [PT]
#rewrite images
RewriteRule ^go/([^/]*)/([^/]*)/([^/]*)/([^/]*)/([^/]*)/([^/]*)/([^/]*)/images/(.*)$ images/$8 [PT]
RewriteRule ^go/([^/]*)/([^/]*)/([^/]*)/([^/]*)/([^/]*)/images/(.*)$ images/$6 [PT]
RewriteRule ^go/([^/]*)/([^/]*)/([^/]*)/images/(.*)$ images/$4 [PT]
RewriteRule ^go/([^/]*)/images/(.*)$ images/$2 [PT]
#rewrite css
RewriteRule ^go/([^/]*)/([^/]*)/([^/]*)/([^/]*)/([^/]*)/([^/]*)/([^/]*)/css/(.*)$ css/$8 [PT]
RewriteRule ^go/([^/]*)/([^/]*)/([^/]*)/([^/]*)/([^/]*)/css/(.*)$ css/$6 [PT]
RewriteRule ^go/([^/]*)/([^/]*)/([^/]*)/css/(.*)$ css/$4 [PT]
RewriteRule ^go/([^/]*)/css/(.*)$ css/$2 [PT]
#rewrite downloads
RewriteRule ^go/([^/]*)/([^/]*)/([^/]*)/([^/]*)/([^/]*)/([^/]*)/([^/]*)/downloads/(.*)$ downloads/$8 [PT]
RewriteRule ^go/([^/]*)/([^/]*)/([^/]*)/([^/]*)/([^/]*)/downloads/(.*)$ downloads/$6 [PT]
RewriteRule ^go/([^/]*)/([^/]*)/([^/]*)/downloads/(.*)$ downloads/$4 [PT]
RewriteRule ^go/([^/]*)/downloads/(.*)$ downloads/$2 [PT]
#rewrite javascript
RewriteRule ^go/([^/]*)/([^/]*)/([^/]*)/([^/]*)/([^/]*)/([^/]*)/([^/]*)/javascript/(.*)$ javascript/$8 [PT]
RewriteRule ^go/([^/]*)/([^/]*)/([^/]*)/([^/]*)/([^/]*)/javascript/(.*)$ javascript/$6 [PT]
RewriteRule ^go/([^/]*)/([^/]*)/([^/]*)/javascript/(.*)$ javascript/$4 [PT]
RewriteRule ^go/([^/]*)/javascript/(.*)$ javascript/$2 [PT]


not the most pretty code but it well works as it should
Back to top


Reply to topic   Topic: Apache 1.3 rewrite? View previous topic :: View next topic
Post new topic   Forum Index -> Other Software