Go Back   CodingForums.com > :: Server side development > Apache configuration

Before you post, read our: Rules & Posting Guidelines

Reply
 
Thread Tools Rate Thread
Enjoy an ad free experience by logging in. Not a member yet? Register.
Old 10-30-2012, 08:24 PM   PM User | #1
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
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.
Sniickerz is offline   Reply With Quote
Old 10-31-2012, 02:54 AM   PM User | #2
Inigoesdr
Super Moderator


 
Inigoesdr's Avatar
 
Join Date: Mar 2007
Location: Florida, USA
Posts: 3,602
Thanks: 2
Thanked 398 Times in 391 Posts
Inigoesdr is a jewel in the roughInigoesdr is a jewel in the roughInigoesdr is a jewel in the rough
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]
Inigoesdr is offline   Reply With Quote
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
Old 11-01-2012, 10:02 PM   PM User | #4
stevenmw
Regular Coder

 
stevenmw's Avatar
 
Join Date: Jun 2007
Location: OK
Posts: 446
Thanks: 26
Thanked 30 Times in 30 Posts
stevenmw is an unknown quantity at this point
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.
stevenmw is offline   Reply With Quote
Old 11-02-2012, 04:50 AM   PM User | #5
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
hmm, I tried. I just don't have any luck.
Sniickerz is offline   Reply With Quote
Reply

Bookmarks

Jump To Top of Thread


Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


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


Advertisement
Log in to turn off these ads.