2009/10/7 nicolaas <[email protected]>:
>
> 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.

Knee-jerk answer below ...

>
> 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]


I suspect that this last line should be something more like:

RewriteRule (.*) http://%{HTTP_HOST}%{REQUEST_URI} [R=301,NC,L]

As your conditions on your rewriting rule already state that we are
looking at https and the URI is not search-results/view/something.

>
> 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]
-~----------~----~----~----~------~----~------~--~---

Reply via email to