Redirect to https
Posted by: TiffanyHome (---.cust.tlapnet.cz)
Date: July 19, 2022 07:39PM

Hello. I have virtual host with path to project. Same in etc host for example viz bellow

But in running have redirected to https and not working.

Another projects working properly. I dont know, pls help


<VirtualHost *:80>
ServerName project.local
ServerAlias www.local
ServerAlias localhost
DocumentRoot "G:\!!WORKING\project\!web"
<Directory />
Options FollowSymLinks
AllowOverride None
</Directory>
<Directory "G:\!!WORKING\project\!web">
Options Indexes FollowSymLinks
Require all granted
AllowOverride All
# Options Indexes FollowSymLinks
# this prevent.htaccess reading, remove if you want .htaccess
#AllowOverride None
# allow web access
#Require all access
</Directory>
</VirtualHost>

<VirtualHost *:80>
ServerAdmin localhost
DocumentRoot "G:\!!WORKING\project\!web"
ServerName project.local
</VirtualHost>

Options: ReplyQuote
Re: Redirect to https
Posted by: Otomatic (Moderator)
Date: July 20, 2022 09:32AM

Hi,

First, Wampserver doesn't do any http to https redirection.

Then, your VirtualHost, it's a bit of a mess and we can see that they have not been created by the tool integrated in Wampserver.

For example:
DocumentRoot "G:\!!WORKING\project\!web"
You don't need backslash but slash /

<Directory "G:\!!WORKINGproject\!web">
Same thing, with the addition of a final slash.

I can only advise you to :
- 1 - reset the httpd-vhosts.conf file to its original value:
# Virtual Hosts
#
<VirtualHost *:80>
  ServerName localhost
  ServerAlias localhost
  DocumentRoot "${INSTALL_DIR}/www"
  <Directory "${INSTALL_DIR}/www/">
    Options +Indexes +Includes +FollowSymLinks +MultiViews
    AllowOverride All
    Require local
  </Directory>
</VirtualHost>
#
- 2 - Put back the file C:\Windows\System32\drivers\etc\hosts to its original value:
127.0.0.1 localhost
::1 localhost

- 3 - Create your Virtualhost with the Wampserver integrated tools:
'http://localhost/add_vhost.php'

- 4 - Modify your VirtualHost to fit your needs.

And before all that, it would be nice to do some checking and updating:

- A - Verify that all VC ++ packages are installed and with the latest versions.
To do this, use the tool:
Checks VC++ packages installed
Do not use a previously loaded tool. Make a new download to make sure you are using the correct version.
To download missing packages, do not rely on Microsoft links, they are not reliable, download packages on http://wampserver.aviatechno.net in section Visual C++ Redistribuable Packages
Do not forget that if you have a 64 bit Windows, you must install both 32 and 64 bit versions of each package.
You must install each package "as an administrator", so right-click the exe file and then run as Administrator.

- B - Apply Update 3.2.9 to your version of Wampserver
Wampserver update 3.2.9

---------------------------------------------------------------
Documentation Apache - Documentation PHP - Documentation MySQL - Wampserver install files & addons

Options: ReplyQuote


Sorry, only registered users may post in this forum.