ReWrite script from apache 1.3 to 2.2

Discuss practical ways rearrange URLs using mod_rewrite.

ReWrite script from apache 1.3 to 2.2

Postby jonnyd91 » Thu Apr 14, 2011 7:29 am

Hi, I had been using the following script for friendly urls and it is working fin in apache 1.3. We just upgraded to apache 2.2.17 and it doesnt seem to be working anymore.

Is there something that needs to be tweaked to work in 2.2?
Code: Select all
http://www.mysite.com/products?BRAND=ADIDAS&VENDORCODE=581 (ORIGINAL URL)

http://www.mysite.com/products/ADIDAS/581 (FRIENDLY URL)



Code: Select all
Options +FollowSymLinks
RewriteEngine On

RewriteRule ^(.*/)?products/([^/]+)/([0-9]+)/?$ $1/products?BRAND=$2&VENDORCODE=$3 [PT,L]
RewriteRule ^(.*/)?products/([^/]+)/([^/]+)/([0-9]+)/?$ $1/products?BRAND=$2&VENDORCODE=$3&offset=$4 [PT,L]

RewriteRule ^(.*/)?DeptItems/([^/]+)/([0-9]+)/?$ $1/DeptItems?BRAND=$2&catCode=$3 [PT,L]
RewriteRule ^(.*/)?DeptItems/([^/]+)/([^/]+)/([0-9]+)/?$ $1/DeptItems?BRAND=$2&catCode=$3&offset=$4 [PT,L]

RewriteRule ^(.*/)?itemdetail/([^/]+)/([^/]+)/?$ $1/itemdetail?BRAND=$2&desc1=$3 [PT,L]

RewriteCond %{SERVER_PORT} !^443$
RewriteRule ^(login|myaccount|register|updateUser|accountedit|confirm|Submit|ReviewOrder|ExpressOrder|DispExpOrder|DispExpInvoice|ShowInfoExp|DispOrderInfoExp|OrderExp)$ https://%{HTTP_HOST}%{REQUEST_URI} [R=301,L]

#RewriteCond %{SERVER_PORT} !^80$
#RewriteRule ^(displayCart)$ http://%{HTTP_HOST}%{REQUEST_URI} [R=301,L]

RewriteCond %{SERVER_PORT} !^80$
RewriteRule ^$ http://%{HTTP_HOST}/ [R=301,L]
jonnyd91
 
Posts: 13
Joined: Sun Nov 16, 2008 9:46 pm

Return to Friendly URLs with Mod_Rewrite

Who is online

Users browsing this forum: Exabot [Bot] and 1 guest

cron