Need help with htaccess change.

Using a single web hosting account to host multiple sites

Need help with htaccess change.

Postby Jack.Straw » Wed Jul 22, 2009 7:18 am

Hello. I've been using the rewrite rules below to make certain directories appear like subdomains. I'm doing this instead of creating actual subdomains so that i can use the same SSL certificate. That works fine.

However, I want to stop forcing https for all pages. I thought this would be as easy as removing the first condition (RewriteCond %{HTTPS} !=on) and removing the S from the first rewrite rule. That didn't work and i'm stumped. Can someone show me how to modify these rules so they stop forcing https? I only want the https for certain pages, which i will control within those pages.

Code: Select all
RewriteEngine on

RewriteCond %{HTTPS} !=on
RewriteCond %{HTTP_HOST} ^emerson.metrolightingcenters.net$ [OR]
RewriteCond %{HTTP_HOST} ^casablanca.metrolightingcenters.net$ [OR]
RewriteCond %{HTTP_HOST} ^philipaustin.metrolightingcenters.net$ [OR]
RewriteCond %{HTTP_HOST} ^builders.metrolightingcenters.net$ [OR]
RewriteCond %{HTTP_HOST} ^credit.metrolightingcenters.net$ [OR]
RewriteCond %{HTTP_HOST} ^employment.metrolightingcenters.net$ [OR]
RewriteCond %{HTTP_HOST} ^catalog.metrolightingcenters.net$ [OR]
RewriteCond %{HTTP_HOST} ^registration.metrolightingcenters.net$
RewriteRule .* https://%{HTTP_HOST}%{REQUEST_URI} [R,L]

RewriteCond %{REQUEST_URI} !^/wildcard_host
RewriteCond %{HTTP_HOST} ^(www\.)?([a-z0-9-]+)\.metrolightingcenters\.net$ [NC]
RewriteCond %{DOCUMENT_ROOT}/wildcard_host/%2/ -d
RewriteRule ^(.*)$ wildcard_host/%2/$1 [L]


Thanks for your time,
-Jack
Jack.Straw
 
Posts: 3
Joined: Sat Mar 15, 2008 4:34 am

Postby richardk » Wed Jul 22, 2009 9:54 am

You need to remove the whole redirect block
Code: Select all
Options +FollowSymLinks

RewriteEngine On

RewriteCond %{ENV:REDIRECT_STATUS} ^$
RewriteCond %{HTTP_HOST} ^(www\.)?([-a-z0-9]+)\.metrolightingcenters\.net$ [NC]
RewriteCond %{DOCUMENT_ROOT}/wildcard_host/%2/ -d
RewriteRule ^(.*)$ /wildcard_host/%2/$1 [QSA,L]
richardk
 
Posts: 8800
Joined: Wed Dec 21, 2005 7:50 am


Return to Domain Handling

Who is online

Users browsing this forum: Google [Bot] and 2 guests

cron