Welcome Guest, Not a member yet? Register   Sign In
Suggested .htaccess rewrite is not hiding system folder
#4

[eluser]Rick Jolly[/eluser]
Well that can't be your only rule, or all urls besides those starting with "system" wouldn't work. For example, you could use rules that look something like this:
Code:
RewriteCond $1 ^system [NC]
RewriteRule ^(.*)$ /index.php?/$1 [L]

RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ /index.php?/$1 [L]
Since "system" is a directory, if the first rule was last, it wouldn't get matched since RewriteCond %{REQUEST_FILENAME} !-d would be true. That says if the REQUEST_FILENAME is a directory, execute the rule.

Quote:What’s the difference between the two?

For you, probably nothing. But I think it is better to not use REQUEST_URI in .htaccess if your RewriteBase is a subdirectory - which apparently doesn't apply to you. Otherwise you'd have to include your subdirectory before the "system" in the REQUEST_URI RewriteCond. It's a subtle difference and only applies if you are working in a subdirectory and using .htaccess.

So I don't think the rewrite rule by itself was the problem. I suspect some other rule above it matched so that rule wasn't executed. The [L] means last - "if this rule matched, don't execute another".

Quote:Why would two rules be needed?
One rule must match, or your script won't be found.


Messages In This Thread
Suggested .htaccess rewrite is not hiding system folder - by El Forum - 01-11-2010, 11:20 AM
Suggested .htaccess rewrite is not hiding system folder - by El Forum - 01-11-2010, 01:05 PM
Suggested .htaccess rewrite is not hiding system folder - by El Forum - 01-11-2010, 01:53 PM
Suggested .htaccess rewrite is not hiding system folder - by El Forum - 01-11-2010, 02:40 PM
Suggested .htaccess rewrite is not hiding system folder - by El Forum - 01-11-2010, 02:50 PM
Suggested .htaccess rewrite is not hiding system folder - by El Forum - 01-11-2010, 03:31 PM
Suggested .htaccess rewrite is not hiding system folder - by El Forum - 01-11-2010, 03:48 PM
Suggested .htaccess rewrite is not hiding system folder - by El Forum - 01-11-2010, 04:27 PM
Suggested .htaccess rewrite is not hiding system folder - by El Forum - 01-11-2010, 04:27 PM
Suggested .htaccess rewrite is not hiding system folder - by El Forum - 01-11-2010, 04:56 PM
Suggested .htaccess rewrite is not hiding system folder - by El Forum - 01-11-2010, 05:00 PM



Theme © iAndrew 2016 - Forum software by © MyBB