logo
Apache Lounge
Webmasters

 

About Forum Index Downloads Search Register Log in RSS X


Keep Server Online

If you find the Apache Lounge, the downloads and overall help useful, please express your satisfaction with a donation.

or

Bitcoin

A donation makes a contribution towards the costs, the time and effort that's going in this site and building.

Thank You! Steffen

Your donations will help to keep this site alive and well, and continuing building binaries. Apache Lounge is not sponsored.
Post new topic   Forum Index -> Apache View previous topic :: View next topic
Reply to topic   Topic: rewrite (https and remove "~" tilde) help
Author
jane



Joined: 04 Nov 2015
Posts: 1

PostPosted: Thu 05 Nov '15 2:50    Post subject: rewrite (https and remove "~" tilde) help Reply with quote

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

please help me with the rewrite rule.
Back to top


Reply to topic   Topic: rewrite (https and remove "~" tilde) help View previous topic :: View next topic
Post new topic   Forum Index -> Apache