I use a .cgi file to run python on my server. However, whenever someone goes to the site, it brings them to https://example.com/main.cgi/ (main.cgi is the name of the cgi file). Is there a way to remove this from the .htacess file, so it goes to https://example.com/ but still runs the cgi file?
This is the current .cgi file:
RewriteEngine On
RewriteBase /website
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^(.*)$ /main.cgi/$1 [L]
RewriteCond %{HTTPS} !=on
RewriteRule ^(.*)$ https://%{HTTP_HOST}%{REQUEST_URI} [L,R=301,NE]
How can I make a RewriteRule
that makes the URL /
go to /main.cgi/
without it appearing in the URL?