Forum Moderators: phranque
RewriteRule ^products/([^/\.]+)/([^/\.]+)/?$ index.php?mc=$1&sc=$2 [L]
RewriteRule ^basket/checkout/delivery?$ checkout_delivery.php [L]
RewriteRule ^basket/checkout/summary?$ checkout_summary.php [L]
RewriteRule ^basket/checkout/payment?$ checkout_payment.php [L]
RewriteCond %{HTTPS} on
RewriteCond %{REQUEST_URI} !^basket/checkout/payment?.*$
RewriteRule ^(.*)$ ht tp://%{HTTP_HOST}%{REQUEST_URI} [R=301,L]
[edited by: jdMorgan at 12:38 pm (utc) on May 4, 2010]
[edit reason] Corrected title as requested. [/edit]
# Redirect HTTPS requests for non-SSL pages back to HTTP. (Note that shared objects
# such as images on both HTTP and HTTPS pages are excluded from this rule)
RewriteCond %{SERVER_PORT} =443
RewriteCond $1 !^basket/checkout/payment
RewriteCond $1 !\.(gif|jpe?g|png|ico|css|js)$
RewriteRule ^(.*)$ http://%{HTTP_HOST}/$1 [R=301,L]
#
# Redirect HTTP requests for SSL checkout page to HTTPS
RewriteCond %{SERVER_PORT} !=443
RewriteRule ^(basket/checkout/payment)$ https://%{HTTP_HOST}/$1 [R=301,L]
#
# Redirect extensionless page requests to remove trailing slash
RewriteRule ^(products/[^/.]+/[^/.]+)/$ http://%{HTTP_HOST}/$1 [R=301,L]
RewriteRule ^(basket/checkout/(delivery|summary|payment))/$ http://%{HTTP_HOST}/$1 [R=301,L]
#
#
# Internally rewrite extensionless page requests to scripts
RewriteRule ^products/([^/.]+)/([^/.]+)$ index.php?mc=$1&sc=$2 [L]
RewriteRule ^basket/checkout/(delivery|summary|payment)$ checkout_$1.php [L]
# Redirect HTTPS requests for non-SSL pages back to HTTP.
RewriteCond %{SERVER_PORT} =443
RewriteCond $1 !^basket/checkout/payment
RewriteCond $1 !\.(gif|jpe?g|png|ico|css|js)$
RewriteRule ^(.*)$ http://%{HTTP_HOST}/~admin17/$1 [R=301,L]
# Redirect HTTP requests for SSL checkout page to HTTPS
RewriteCond %{SERVER_PORT} !=443
RewriteRule ^(basket/checkout/payment)$ https://%{HTTP_HOST}/~admin17/$1 [R=301,L]
# Redirect extensionless page requests to remove trailing slash
RewriteRule ^(products/[^/.]+/[^/.]+)/$ http://%{HTTP_HOST}/~admin17/$1 [R=301,L]
RewriteRule ^(basket/checkout/(delivery|summary|payment))/$ http://%{HTTP_HOST}/~admin17/$1 [R=301,L]
# Internally rewrite extensionless page requests to scripts
RewriteRule ^basket/checkout/(delivery|summary|payment)$ checkout_$1.php [L]
# Declare hostname (one of three, comment-out any two of these)
# RewriteRule ^ - [E=HostName:www.example.com]
RewriteRule ^ - [E=HostName:localhhost]
# RewriteRule ^ - [E=HostName:test-domain.com]
#
# Do some redirect using variable hostname defined above
RewriteRule ^foo\.html$ http://%{ENV:HostName}/bar.html [R=301.L]