It seems to work well in any directory except /cgi-bin/.
For example, when I try to switch from http:// to https:// by using the following RewriteRule:
- Code: Select all
RewriteCond %{SERVER_PORT} !^443$
RewriteRule ^(.+)$ "https://%{HTTP_HOST}/$1" [R=301,L]
It won't switch to https:// for an URL like:
- Code: Select all
http://localhost/cgi-bin/test.cgi
While it does this pretty well for an URL like:
- Code: Select all
http://localhost/test.html
2.) Is there something wrong with my C:\xampp\apache\conf\httpd.conf?
Or do i need to place another .htaccess-File copy in the cgi-bin-Folder? In order to work correctly?
But when I try to do so, my webbrowser says that I dont have permission to access the CGI-scripts in /cgi-bin/ by telling me:
For example: URL:
- Code: Select all
http://localhost/cgi-bin/Test1.cgi
Results in:
- Code: Select all
"Forbidden
You don't have permission to access this resource."
Apache/2.4.56 (Win64) OpenSSL/1.1.1t PHP/8.2.4 Server at localhost Port 80
Iam using Windows7 Pro with XAMPP.
Firefox Version 115.
I tried to copy the .htaccess-File from DocumentRoot / to /cgi-bin with result Error 403 Forbidden.
Thanks for your answers in advance.