Code Igniter blocking access to /cgi-bin |
[eluser]yello[/eluser]
Hi, I don't know why but it seems the .htaccess of my CI installation is blocking access to my scripts within the {root}/cgi-bin/ folder. When I try to access them I get the standard CI 404 Not Found message. Here is my htacess: Code: <IfModule mod_rewrite.c> It is very basic as you can see, I don't know why it is not working properlly! Does anyone can help me fix this issue? Thanks!
[eluser]Clooner[/eluser]
[quote author="yello" date="1205141343"] Code: RewriteBase / Maybe the cgi-bin is not directly in the rewritebase therefor it misses some of the rules. But anyway include an exception for anything with "cgi-bin" in your rules and problems should be fixed
[eluser]yello[/eluser]
How do I do that? (i'm sorry but I really suck with mod_rewrite)
[eluser]yello[/eluser]
<IfModule mod_rewrite.c> RewriteEngine On RewriteBase / RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{REQUEST_FILENAME} !-d RewriteCond %{REQUEST_URI} !^/cgi-bin RewriteRule ^(.*)$ index.php/$1 [L] </IfModule> this does not work either
[eluser]Clooner[/eluser]
Try it like this Code: RewriteCond %{REQUEST_URI}!(cgi-bin) [NC] If it doesn't work try this cheat sheet.
[eluser]yello[/eluser]
<IfModule mod_rewrite.c> RewriteEngine On RewriteBase / RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{REQUEST_FILENAME} !-d RewriteCond %{REQUEST_URI}!(cgi-bin) [NC] RewriteRule ^(.*)$ index.php/$1 [L] </IfModule> doesn't work either, however, I can access /cgi-bin/ now, when trying to launch the .cgi script inside, it doesn't work, 500 Internal Server Error... What to look for in the cheat sheet? I don't get it
[eluser]Techie-Micheal[/eluser]
This worked for me (for things other than the cgi-bin, but should still work) Code: RewriteEngine On From a glance, it looks like the only difference between what I have and what you have is the spacing.
[eluser]yello[/eluser]
I appreciate your fast anwser but it does not seem to work. Code: Code: That code works... when I try to access domain/dir1 it bypass the rewrite rule... but <b>as soon as I change it to cgi-bin</b> it does not work: Code: Code: I really don't know why it is not working since the only thing I changed is the dir name! Help!
[eluser]Techie-Micheal[/eluser]
[quote author="yello" date="1205314023"]I appreciate your fast anwser but it does not seem to work. Code: Code: That code works... when I try to access domain/dir1 it bypass the rewrite rule... but <b>as soon as I change it to cgi-bin</b> it does not work: Code: Code: I really don't know why it is not working since the only thing I changed is the dir name! Help![/quote] Why are you putting it in parenthesis? I don't think I've seen that before. Have you tried /cgi-bin instead of (cgi-bin)? |
Welcome Guest, Not a member yet? Register Sign In |