Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 5 of 5

Thread: Heyooo!

  1. #1
    New Coder
    Join Date
    Oct 2010
    Posts
    16
    Thanks
    1
    Thanked 0 Times in 0 Posts

    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.

  • #2
    Super Moderator Inigoesdr's Avatar
    Join Date
    Mar 2007
    Location
    Florida, USA
    Posts
    3,638
    Thanks
    2
    Thanked 404 Times in 396 Posts
    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]

  • #3
    New Coder
    Join Date
    Oct 2010
    Posts
    16
    Thanks
    1
    Thanked 0 Times in 0 Posts
    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:

    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]

  • #4
    Regular Coder stevenmw's Avatar
    Join Date
    Jun 2007
    Location
    OK
    Posts
    497
    Thanks
    27
    Thanked 31 Times in 31 Posts
    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.

  • #5
    New Coder
    Join Date
    Oct 2010
    Posts
    16
    Thanks
    1
    Thanked 0 Times in 0 Posts
    hmm, I tried. I just don't have any luck.


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •