dcsimg
www.webdeveloper.com
Results 1 to 6 of 6

Thread: HTACCESS question

  1. #1
    Join Date
    Sep 2005
    Location
    Portland Oregon
    Posts
    153

    HTACCESS question

    I have a directory structure such as:
    /root/sub1/sub2/file.php

    My .htaccess file looks like:
    rewriteEngine On
    RewriteCond %{HTTPS} !=on
    RewriteRule ^sub1(.*) https://%{SERVER_NAME}/sub1$1 [R,L]

    This rewrites the access to /root/sub1/* as requiring https. This is great. However I have one exception.

    I have a file in sub2 that I do NOT want to be SSL protocol (https). How can I enable access to this one file via http without destroying my global https setting?

    I.e. /root/sub1/sub2/file1.php - stay http
    /root/sub1/* - require https

  2. #2
    Join Date
    Jan 2005
    Location
    Alicante (Spain)
    Posts
    7,742
    What this got to do with PHP?

  3. #3
    Join Date
    Sep 2005
    Location
    Portland Oregon
    Posts
    153
    Well, PHP most commonly runs on Apache. A search of the archtives for 'htaccess' showed that most of the messages were in the PHP forum.

  4. #4
    Join Date
    Jun 2007
    Posts
    112
    The way I dealt with this kind of problem was actually pretty poor, but it works. I have the reverse situation: one page in my docroot needs to be accessed by HTTPS. To do that, I just checked to see if the server port wasn't 443. If not, I used the location header to reset it.

    I guess that doesn't help you , but there it is.

    Umm... Sorry I couldn't solve your problem.

  5. #5
    Join Date
    Sep 2005
    Location
    Portland Oregon
    Posts
    153
    Thanks anyway....

  6. #6
    Join Date
    May 2004
    Location
    FL
    Posts
    3,453
    (moved from the PHP forum)

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Posting Permissions

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



Recent Articles