capcom Posted February 27, 2021 Posted February 27, 2021 (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,denydeny from all</Files> IndexIgnore * RewriteEngine OnRewriteBase /RewriteRule ^(media/.*)$ - [L]RewriteRule ^(admin_media/.*)$ - [L]RewriteRule ^(flask\.wsgi/.*)$ - [L]RewriteRule ^(.*)$ flask.wsgi/$1 [QSA,PT,L] Thanks for the help. Edited February 27, 2021 by capcom
wolstech Posted February 27, 2021 Posted February 27, 2021 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]
capcom Posted February 27, 2021 Author Posted February 27, 2021 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.
capcom Posted February 27, 2021 Author Posted February 27, 2021 It did work after I moved it after rewritebase. Had missed that earlier. Thanks.
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now