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 Quote
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] Quote
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. Quote
capcom Posted February 27, 2021 Author Posted February 27, 2021 It did work after I moved it after rewritebase. Had missed that earlier. Thanks. Quote
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.