Welcome Guest. Please Login or Register  


You are here: Index > AMPPS > General Support > Topic : redirect to https by defautl



Threaded Mode | Print  

 redirect to https by defautl (3 Replies, Read 4483 times)
priyanshuz
Group: Member
Post Group: Newbie
Posts: 3
Status:
I have created a website with ampps, now the  problem is , I want my website to redirect to https by default. Can anyone please help me to achieve that.

Thank you
IP: --   

redirect to https by defautl
jigar
Group: Member
Post Group: Newbie
Posts: 27
Status:
Look for the virtualhost of your domain(e.g domain1.com in below example) in virtualhosts file located at ampps\apache\extra\httpd-vhosts.conf and add the following three lines in the beginning of the VirtualHost tag :

Code

RewriteEngine On
RewriteCond %{HTTPS} off
RewriteRule (.*) https://domain1.com


So it will look like :

Code
<VirtualHost 127.0.0.1:80>
RewriteEngine On
RewriteCond %{HTTPS} off
RewriteRule (.*) https://domain1.com
<Directory "e:/program files/ampps/www/domain1.com">
Options FollowSymLinks Indexes
AllowOverride All
Order deny,allow
allow from All
</Directory>
ServerName domain1.com
ServerAlias domain1.com
ScriptAlias /cgi-bin/ "e:/program files/ampps/www/domain1.com/cgi-bin/"
DocumentRoot "e:/program files/ampps/www/domain1.com"
ErrorLog "E:/Program Files/ampps/apache/logs/domain1.com.err"
CustomLog "E:/Program Files/ampps/apache/logs/domain1.com.log" combined
</VirtualHost>


It strictly recommend you to create other .conf file if you are going to maintain it on your own. Because Ampps keeps regenrating the file ampps\apache\extra\httpd-vhosts.conf and you may lose your manual configuration.
IP: --   

redirect to https by defautl
priyanshuz
Group: Member
Post Group: Newbie
Posts: 3
Status:
I did created an extra conf file as you told me. But amps is still poinitng the the original httpd-vhosts.conf

its not picking up the the configuration from the file I created.

Please advise.
IP: --   

redirect to https by defautl
priyanshuz
Group: Member
Post Group: Newbie
Posts: 3
Status:
I figured it out. When I put the extra config file in the ampps\apache\extra\ folder. I didnt include the new conf file in the apache config file.

Once I included it , it worked.

Thank you very much for the help.

IP: --   

« Previous    Next »

Threaded Mode | Print  



Jump To :


Users viewing this topic
1 guests, 0 users.


All times are GMT. The time now is May 24, 2024, 10:21 pm.

  Powered By AEF 1.0.8 © 2007-2008 Electron Inc.Queries: 10  |  Page Created In:0.035