Welcome Guest, Not a member yet? Register   Sign In
default htacess causing headaches
#1

[eluser]smatakajr[/eluser]
Hey Guys

This is a wierd one here... you know the default CI .htacess
with these lines here

RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ index.php/$1 [L]

Well I have an external custom DB manager ins a/subdir/ to the root CI
that I block access with .htaccess authorization

So here is the pickle ...

if i comment those lines above everything works well for my DB manager ...
but i cannot use CI which is not an option

If I dont comment those lines i get a CI 404 error accessing the /subdir/

If I remove the .htacess auth from the /subdir/ everything works fine

It looks like the call to /subdir/ then the call of .htacess
cause the rewrite rule to send to index.php which results in a 404

Does anybody have a way around this...

Thanks
Ricky
#2

[eluser]danmontgomery[/eluser]
Before those 3 lines,

Code:
RewriteCond $1 ^(folder_1|folder_2|robots\.txt)
RewriteRule ^(.*)$ - [PT,L]

You can add any folders or files (be sure to escape special characters) to the list separated by | and they will not be routed through CI... The filenames are relative to the location of .htaccess
#3

[eluser]smatakajr[/eluser]
You are the man!! I was struggling with this for days... if you dont mind me asking
what does this do

RewriteRule ^(.*)$ - [PT,L]

the PT,L part?
#4

[eluser]smatakajr[/eluser]
On second thought.. it worked and let me in, now when i go back to new browser i get 404 error again Sad
#5

[eluser]danmontgomery[/eluser]
http://httpd.apache.org/docs/2.2/mod/mod_rewrite.html

Quote:'passthrough|PT' (pass through to next handler)
This flag forces the rewrite engine to set the uri field of the internal request_rec structure to the value of the filename field. This flag is just a hack to enable post-processing of the output of RewriteRule directives, using Alias, ScriptAlias, Redirect, and other directives from various URI-to-filename translators.
Quote:'last|L' (last rule)
Stop the rewriting process here and don't apply any more rewrite rules. This corresponds to the Perl last command or the break command in C. Use this flag to prevent the currently rewritten URL from being rewritten further by following rules. Remember, however, that if the RewriteRule generates an internal redirect (which frequently occurs when rewriting in a per-directory context), this will reinject the request and will cause processing to be repeated starting from the first RewriteRule.

The 404 page might be in browser cache.




Theme © iAndrew 2016 - Forum software by © MyBB