BenSeb

msg:3150581 | 8:18 pm on Nov 8, 2006 (gmt 0) |
ok got this far: in /.htaccess RewriteEngine On RewriteCond %{SERVER_PORT} 443 RewriteRule ^(.*)$ [test.domain.com...] [R,L] in /checkout/.htaccess RewriteEngine on RewriteCond %{SERVER_PORT}!^443$ RewriteRule ^(.*)$ https://test.domain.com/checkout/$1 [R=301,L] This works for 99% of cases, except when you load: [test.domain.com...] (with no trailing slash or filename) which then goes to: https://test.domain.com/checkout//home/vhosts/test.domain.com/httpdocs/checkout Any ideas?
|
jdMorgan

msg:3150658 | 9:46 pm on Nov 8, 2006 (gmt 0) |
No idea if this will help, but there's a serious logic error that needs to be fixed before proceeding. The problem is caused by the fact that the main /.htaccess will be processed for all requests, including requests to /checkout. As a result, the code in /.htaccess needs to know not to rewrite https /checkout requests to http: In /.htaccess
RewriteEngine on RewriteCond %{SERVER_PORT} ^443$ RewriteCond $1 !^checkout RewriteRule (.*) http://test.domain.com/$1 [R,L]
Jim
|
nakulgoyal

msg:3150674 | 9:55 pm on Nov 8, 2006 (gmt 0) |
Jim, I am not saying you are wrong. But tell me if I am wrong please. Does the child folder .htaccess not overwrite all parent folder commands? What if your host has something in /home folder? Does our .htaccess in our home folder overwrite any settings in there?
|
BenSeb

msg:3150727 | 10:47 pm on Nov 8, 2006 (gmt 0) |
with that amend it works fine :) Cheers the only problem is, the images css and js files are rewritten back to http:// because they are not in the checkout folder! Can we get a slight amend so that it only redirects actual pages rather than the images, etc? would need to deal with php pages (and obviously domain.com/ where pagename is not shown..,) Ben
|
jdMorgan

msg:3150736 | 10:52 pm on Nov 8, 2006 (gmt 0) |
nakulgoyal, Overwrite? No. The top-level rewrites will be invoked, followed by the lower-level rewrites, but both will occur. And since an external redirect is involved, that's not good. Ben, You should be able to add an exclusion to the /checkout/.htaccess file, in much the same way as I showed for the /.htaccess exclusion. I'm not clear on all the exclusions you might need, but the pattern for css and js files would be something like !\.(css¦js)$ Note: No start anchor, because we're only looking at the .js or .css suffix, and you must replace the broken pipe "¦" character shown with a solid pipe character from your keyboard; Posting on this forum modifies the pipe characters. Jim
|
BenSeb

msg:3150750 | 11:03 pm on Nov 8, 2006 (gmt 0) |
Thanks jim I'll try this. But should the exclusion go in the /.htaccess file, as the images etc are within the /images folder, and it is this htaccess file which is rewriting https > http? Ben
|
jdMorgan

msg:3150783 | 11:43 pm on Nov 8, 2006 (gmt 0) |
I don't know how your site is set up. I encourage you to experiment, though, as this is a discussion forum [webmasterworld.com], not a help desk, and the only way to learn is to try. :) Jim
|
nakulgoyal

msg:3150949 | 3:31 am on Nov 9, 2006 (gmt 0) |
Thanks Jim, for clarifying. I appreciate your time.
|
|