Keep Server Online
If you find the Apache Lounge, the downloads and overall help useful, please express your satisfaction with a donation.
or
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.
| |
|
Topic: rewrite (https and remove "~" tilde) help |
|
Author |
|
jane
Joined: 04 Nov 2015 Posts: 1
|
Posted: Thu 05 Nov '15 2:50 Post subject: rewrite (https and remove "~" tilde) help |
|
|
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 |
|
|
|
|
|
|