Enable .htaccess
Posted by: forestDean (---.range109-154.btcentralplus.com)
Date: February 18, 2023 07:32PM

I have tested a website on VirtualHost with an index.htm & it works fine. When I install the full website with .htaccess I get: 'This site can’t be reached xxx refused to connect. ERR_CONNECTION_REFUSED'

I edited httpd.config:

<Directory />
#    AllowOverride none
#    Require all denied

# AllowOverride controls what directives may be placed in .htaccess files.
# It can be "All", "None", or any combination of the keywords:
#   AllowOverride FileInfo AuthConfig Limit
#   
AllowOverride all

</Directory>

I edited httpd-vhost.config:

<VirtualHost *:80>
	ServerName ****
	DocumentRoot "g:/wampserver/www/****"
	<Directory  "g:/wampserver/www/****/">
		Options +Indexes +Includes +FollowSymLinks +MultiViews
		AllowOverride All
		Require local
	</Directory>
  <IfModule fcgid_module>
    Define FCGIPHPVERSION "7.4.33"
    FcgidInitialEnv PHPRC ${PHPROOT}${FCGIPHPVERSION}
    <Files ~ "\.php$">
      Options +Indexes +Includes +FollowSymLinks +MultiViews +ExecCGI
      AddHandler fcgid-script .php
      FcgidWrapper "${PHPROOT}${FCGIPHPVERSION}/php-cgi.exe" .php
    </Files>
  </IfModule>
</VirtualHost>

I restarted the WAMP but still no connection.

.htaccess reads:

RewriteRule ^ []%{HTTP_HOST}%{REQUEST_URI}
RewriteRule ^$ /current/ [R=301,L]

I noticed that the httpd.config autocorrects to:

<Directory "${INSTALL_DIR}/www/****/">



Edited 1 time(s). Last edit at 02/18/2023 09:53PM by RiggsFolly.

Options: ReplyQuote
Re: Enable .htaccess
Posted by: Otomatic (Moderator)
Date: February 19, 2023 09:59AM

The httpd.conf file (not httpd.config) must not be modified.
The changes you have made are an open door to intrusions!

You have added an .htaccess file: what is it supposed to do?

Shouldn't it be "RewriteEngine On" in this file?

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

Options: ReplyQuote
Re: Enable .htaccess
Posted by: forestDean (---.range109-154.btcentralplus.com)
Date: February 19, 2023 10:43AM

The full .htaccess is:

RewriteEngine On
RewriteCond %{HTTPS} !=on [OR]
RewriteCond %{SERVER_PORT} 80

RewriteRule ^ []%{HTTP_HOST}%{REQUEST_URI}
RewriteRule ^$ /current/ [R=301,L]


In httpd-vhosts.config, will:
AllowOverride All
enable the .htaccess for that specific directory?



Edited 2 time(s). Last edit at 02/19/2023 11:05AM by forestDean.

Options: ReplyQuote
Re: Enable .htaccess
Posted by: Otomatic (Moderator)
Date: February 19, 2023 02:09PM

> enable the .htaccess for that specific directory?

The Apache documentation is here: Apache documentation

and, more specifically for AllowOverride

I had asked you a question about this .htaccess file: what is it supposed to do?
You didn't answer it!

A priori, it is to force the https mode !

Basically, Apache Wampserver does not support https mode, so it's not surprising that it doesn't work.
You need to get your hands dirty and read and apply item 7 of Wampserver 3 - Some explanations

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

Options: ReplyQuote
Re: Enable .htaccess
Posted by: webmasterinnj (---.cmdnnj.fios.verizon.net)
Date: February 20, 2023 09:05PM

"AllowOverride All
Require local"

change to AllowOverride All
Require all granted

[www.twitch-haven.webredirect.org]

Options: ReplyQuote


Sorry, only registered users may post in this forum.