Thread: Heyooo!
View Single Post
Old 10-31-2012, 05:15 AM   PM User | #3
Sniickerz
New Coder

 
Join Date: Oct 2010
Posts: 16
Thanks: 1
Thanked 0 Times in 0 Posts
Sniickerz is an unknown quantity at this point
Quote:
Originally Posted by Inigoesdr View Post
Not sure if this is exactly what you want, but try something like this:

Code:
RewriteEngine on

# Redirect requests to the /client folder if they are on not on www.domain.com and using HTTPS
RewriteCond %{REQUEST_URI} ^/client
RewriteCond %{HTTPS} !=on [OR]
Rewritecond %{HTTP_HOST} !^www\.domain\.com
RewriteRule .* https://www.domain.com%{REQUEST_URI} [L,R=301]

# Redirect any remaining requests that aren't on the proper domain
Rewritecond %{HTTP_HOST} !^www\.domain\.com
RewriteRule .* https://www.domain.com%{REQUEST_URI} [L,R=301]
I appreciate your help, it's almost the same code as mine, sorta kinda.

However im looking for something to where if the user isn't in /client then make sure that the "HTTPS" is not in use.

so https://www.domain.com/client <--- That's ok

https://www.domain.com/folder <---- Not ok.

I only want "https" to work only inside of the /client folder

I still appreciate your help though!

Here's my code:

Quote:
RewriteEngine on
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME}\.html -f
RewriteRule ^(.*)$ $1.html
RewriteCond %{REQUEST_FILENAME}\.php -f
RewriteRule ^(.*)$ $1.php

RewriteEngine On
RewriteCond %{HTTP_HOST} ^domain.com
RewriteRule (.*) http://www.domain.com/$1 [R=301,L]

RewriteEngine On
RewriteCond %{SERVER_PORT} 80
RewriteCond %{REQUEST_URI} client
RewriteRule ^(.*)$ https://www.domain.com/$1 [R,L]
Sniickerz is offline   Reply With Quote