Showing posts with label Apache Redirect. Show all posts
Showing posts with label Apache Redirect. Show all posts

Tuesday, 27 January 2015

Apache redirect to HTTPS


Apache redirect to HTTPS from any port / or host


RewriteEngine on
ReWriteCond %{SERVER_PORT} !^443$
RewriteRule ^/(.*) https://%{HTTP_HOST}/$1 [NC,R,L] 

#bearMan

Monday, 9 December 2013

OHS: Virtual Host With Redirect

Apache: Virtual Host With Redirect

In your httpd.conf, under Virtual Hosts

In this example we will be redirecting example.website.com to example.website.com/prac/
This redirect only works when landing on / with no additional URI

<VirtualHost *:80>
 ServerName  example.website.com
 RewriteEngine on
 RewriteRule ^/$ /prac/ [R]
</VirtualHost>

#bearMan