1. Advertising
    y u no do it?

    Advertising (learn more)

    Advertise virtually anything here, with CPM banner ads, CPM email ads and CPC contextual links. You can target relevant areas of the site and show ads based on geographical location of the user if you wish.

    Starts at just $1 per CPM or $0.10 per CPC.

rewrite (https and remove "~" tilde) help

Discussion in 'Apache' started by Jane Cua, Nov 5, 2015.

  1. #1
    I am using home_dir for my users to have their own area to host their group site. I want to use https instead of just http.

    My objective is to be able to do https and remove "~" tilde = https://myurl.com/jane

    I've added the following Rewrite Rules

    RewriteEngine On
    # this redirects from http to https
    RewriteCond %{HTTPS} !=on
    RewriteRule (.*) https://%{HTTP_HOST}%{REQUEST_URI}

    # This removes the tilde "~" from home dir url
    RewriteCond %{REQUEST_URI} ^/([^/]+)
    RewriteCond /home/%1 -d
    RewriteRule ^/([^/]+)(.*) /home/$1/public_html/$2

    With both rewrite there. I am able to do the following:
    https://myurl.com/~jane

    and
    https://myurl.com/jane
    Gives a 404 Not found

    - - -
    Not Found
    The requested URL /jane/ was not found on this server.
    - - -

    If I remove the Redirect for https.
    I am able to do
    http://myurl/jane

    But I want https://myurl.com/jane
     
    Jane Cua, Nov 5, 2015 IP