CodingForums.com

CodingForums.com (http://www.codingforums.com/index.php)
-   Apache configuration (http://www.codingforums.com/forumdisplay.php?f=69)
-   -   Heyooo! (http://www.codingforums.com/showthread.php?t=280143)

Sniickerz 10-30-2012 08:24 PM

Heyooo!
 
Hello guys, I have a quick question. I've tried it out, however I'm not sure what I'm doing..


I want this:

domain.com/client (that'll redirect into https://www.domain.com/client) I got this working perfectly.

However, I don't want "https" outside of the "client" directory. So when people type in "https://www.domain.com/index.php" it will redirect into just "www.domain.com".

I also have 1 more redirect that if you just type in: "domain.com/lol" it'll redirect into "www.domain.com/lol".

The only problem I'm having is the "https" outside of the "client" directory. Would anyone know how to do this?

thank you for your time.

Inigoesdr 10-31-2012 02:54 AM

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]


Sniickerz 10-31-2012 05:15 AM

Quote:

Originally Posted by Inigoesdr (Post 1287088)
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]

stevenmw 11-01-2012 10:02 PM

Turn off SSL in all of the directories, and turn it on in /client.

I don't have time to Google you up a link right now, but search for enabling SSL. Or disabling.

Good luck.

Sniickerz 11-02-2012 04:50 AM

hmm, I tried. I just don't have any luck.


All times are GMT +1. The time now is 06:50 AM.

Powered by vBulletin®
Copyright ©2000 - 2013, Jelsoft Enterprises Ltd.