Jump to content

[Answered] cgi-bin 404 error


capcom

Recommended Posts

Hello, I am working on discord bot(https://wiki.helionet.org/tutorials/discord-bot#starting-and-stopping-your-bot) and created files inside my cgi-bin directory.

 

but when I try to access from browser, it is giving me 404 error.  I think it has to do with htaccess but want to see if I can only open up cgi-bin folder with a command?

 

here is my htaccess file

 

<Files .htaccess>
order allow,deny
deny from all
</Files>
 
IndexIgnore *
 
RewriteEngine On
RewriteBase /
RewriteRule ^(media/.*)$ - [L]
RewriteRule ^(admin_media/.*)$ - [L]
RewriteRule ^(flask\.wsgi/.*)$ - [L]
RewriteRule ^(.*)$ flask.wsgi/$1 [QSA,PT,L]
 

 

 

Thanks for the help.

Edited by capcom
Link to comment
Share on other sites

The Flask rewrite rules are interfering with it. Those rules take all requests except requests to media, admin_media, or flask.wsgi and force them through flask.

 

Assuming the cgi-bin folder you're using is in the same folder as the flask app, you need to add an exception for cgi-bin under the RewriteBase line:

RewriteRule ^(cgi-bin/.*)$ - [L]
Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...