Vesta Control Panel - Forum

Community Forum

Skip to content

Advanced search
  • Quick links
    • Main site
    • Github repo
    • Google Search
  • FAQ
  • Login
  • Register
  • Board index Main Section Web Server
  • Search

rewrite in .htaccess has no effect

Questions regarding the Web Server
Apache + Nginx, Nginx + PHP5-FPM
Post Reply
  • Print view
Advanced search
2 posts • Page 1 of 1
jimmyeao
Posts: 30
Joined: Fri Nov 27, 2015 2:13 pm

rewrite in .htaccess has no effect
  • Quote

Post by jimmyeao » Fri Dec 18, 2015 11:09 am

I have this in a .htaccess file

Code: Select all

RewriteCond %{ENV:HTTPS} !1
RewriteRule ^(.*)$ https://%{HTTP_HOST}/%1 
So that visitors trying to access that site using https are redirected to http.
However, it seems to be ignored OR Vesta (using nginx as a proxy with Apache) is intercepting the https and redirecting it elsewhere.
Any https request for a non https site ends up on my first https domain :/
for example, lets say I have 2 domains, nonsecure.net and secure.net
nonsecure.net has no https. secure.net has https.
If i try https://nonseure.net the webpage returned is actually the site under https://secure.net...
Top

Elizine
Posts: 50
Joined: Wed Aug 12, 2015 12:11 pm
Contact:
Contact Elizine
Website

Re: rewrite in .htaccess has no effect
  • Quote

Post by Elizine » Sat Dec 19, 2015 10:45 am

Ensure you have this line in your httpd.conf:

Code: Select all

AllowOverride All
AllowOverride controls what directives may be placed in .htaccess files.

In order to test whether .htaccess is enabled or not, insert some junk text in it and see if it generated a 500 internal error or not.
Top


Post Reply
  • Print view

2 posts • Page 1 of 1

Return to “Web Server”



  • Board index
  • All times are UTC
  • Delete all board cookies
  • The team
Powered by phpBB® Forum Software © phpBB Limited
*Original Author: Brad Veryard
*Updated to 3.2 by MannixMD
 

 

cron

Login  •  Register

I forgot my password