Jump to content

Recommended Posts

Posted (edited)

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
Posted

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]

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...