Hi
Here is the htaccess that I have successfully used for a client. Please note
that you can have issues with images/css/favicon/javascript files that would
otherwise redirect to http without the conditionals that I have added. Add
the appropriate ones for yourself.
The payment url/directory was secure. You need to partition your pages so
that defined pages/directories are secure.
RewriteCond %{SERVER_PORT} 80
RewriteCond %{REQUEST_URI} payment(.*)$
RewriteRule (.*) https://www.domain.com.au/$1 [R=301,L]
RewriteCond %{SERVER_PORT} 443
RewriteCond %{REQUEST_URI} !^payment(.*)$ [or]
RewriteCond %{REQUEST_URI} !^favicon\.png$ [or]
RewriteCond %{REQUEST_URI} !^favicon\.ico$ [or]
RewriteCond %{REQUEST_URI} !^swf/topphotos.swf$ [or]
RewriteCond %{REQUEST_URI} !^images/ [or]
RewriteCond %{REQUEST_URI} !^css/ [or]
RewriteCond %{REQUEST_URI} !^js/
RewriteRule (.*) http://www.domain.com.au/payment/ [R=301,L]
Kind regards
Michael Brandon
SearchMasters.co.nz
-----Original Message-----
From: [email protected] [mailto:[email protected]] On Behalf
Of nicolaas
Sent: Wednesday, 7 October 2009 4:19 p.m.
To: NZ PHP Users Group
Subject: [phpug] help needed with .htaccess - sorry slightly off-topic
Hi
Sorry, this is slightly off-topic.
I have the following in my .htaccess file, but it is causing errors.
Basically, what i want to achieve is to have
http://www.mysite.com/search-results/view/bla-bla
in SSL mode and the rest of the site in normal mode. Here is what
my .htaccess looks like. The three commented out lines cause grieve
if I "uncomment" them. If I leave them commented-out the the site
runs fine. When I get to http://www.mysite.com/search-results/view/bla-bla
it turns to https mode. That is fine, but it never returns to normal
mode.
Can you help?
<IfModule mod_dir.c>
DirectorySlash Off
</IfModule>
RewriteEngine On
RewriteBase /
#RewriteCond %{REQUEST_URI} !^search-results/view/(.*)
#RewriteCond %{HTTPS} on
#RewriteRule !^search-results/view/(.*) http://%{HTTP_HOST}%{REQUEST_URI}
[R=301,NC,L]
RewriteCond %{HTTPS} off
RewriteRule ^search-results/view/(.*)
https://%{HTTP_HOST}:20445%{REQUEST_URI}
[R=301,NC,L]
# standard stuff
RewriteCond %{REQUEST_URI} !(\.gif)|(\.html)|(\.jpg)|(\.png)|(\.css)|
(\.js)|(\.php)$
RewriteCond %{REQUEST_URI} ^(.*)$
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule .* sapphire/main.php?url=%1&%{QUERY_STRING} [L]
--~--~---------~--~----~------------~-------~--~----~
NZ PHP Users Group: http://groups.google.com/group/nzphpug
To post, send email to [email protected]
To unsubscribe, send email to
[email protected]
-~----------~----~----~----~------~----~------~--~---