First, this site seems awesome, and I want you to know that I was directly forwarded here from the tech support of my service provider, so sounds like you guys are pretty well-known. I hope you can help a pretty amateur programmer and webmaster work through what I need to do with .htaccess.
Our website is [removed as unecessary], and long story short, the whole thing started when Google randomly decided to index a few of our pages as https instead of http, and people didn't want to go to them because their browsers would warn them that the pages weren't secure (of course they weren't, they weren't supposed to be). So I started a journey to figure out how to fix that. Within that journey I also figured out that it would be good to redirect all http:// to http://www. So now I am trying to do both of those things, and based on what I have read in this forum and other places, sounds like .htaccess is the best way to do both.
First question is: Our server is not *nix but IIS 6 - however they do support the ISAPI Rewrite Filter. I could not find much information on your forums on how to use .htaccess for IIS, but I did come across one post saying that with ISAPI, you can pretty much use the same code as you would for mod_rewrite because it is based off of that. So that is what I am doing - I hope that will work, please let me know if not and I need a different approach.
With that said, I am copying code from 3 posts and trying to adapt them to my situation:
1. http to www - http://www.highranki...dpost__p__60341
2. https to http - http://www.highranki...post__p__283267
3. setting up a special robots.txt file to disallow any further https crawling: http://www.highranki...post__p__298856
So: I want my .htaccess file to 1) redirect all http to www, 2) all https to http EXCEPT for one folder maitreya.org/store where our e-commerce is, and 3) make the special robots.txt file work so no more https can be spidered. Here is what I have so far:
Options +FollowSymLinks RewriteEngine on RewriteCond %{HTTP_HOST} ^maitreya\.org RewriteRule ^(.*)$ [url="http://www.site.tld/$1"]http://www.site.tld/$1[/url] [R=permanent,L] Options +FollowSymlinks RewriteEngine on RewriteCond %{SERVER_PORT} ^443$ RewriteCond %{REQUEST_URI} !^/store/^ RewriteRule ^(.*)$ [url="http://site.tld/$1"]http://site.tld/$1[/url] [R=301,L] RewriteCond %{SERVER_PORT} ^443$ RewriteRule ^robots.txt$ robots_ssl.txt
So how am I doing so far? For example, do I need to put "Options +FollowSymLinks" and "RewriteEngine on" twice, or can i remove one? And I sort of guessed with creating the exception for the /store/ folder, did I guess correectly? Any help would be most appreciated. Thanks very much!
Noor