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]
Posted

Thanks,I did try but didn't work. Gives same error. Does the placement of that rule matters? Also anything about permission, i have set as 755.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...