I’m trying to write some htaccess code that will prevent users from being able to go to a sub-directly directly or any directories within that sub-directory.
RewriteRule and RedirectMatch belong to two seperate modules in your apache installation. There’s obviously a lot of things that differ, but the most important ones would be;
RedirectMatch is going to physically move you to the url you specify, with less control over the users address bar. The rewriteengine doesn’t need to be activated, hence less memory usage.
If you want the address bar to show something else than what you’re directing them to however, making a RewriteRule is better.
[QUOTE=sekasi;2337433]RewriteRule and RedirectMatch belong to two seperate modules in your apache installation. There’s obviously a lot of things that differ, but the most important ones would be;
RedirectMatch is going to physically move you to the url you specify, with less control over the users address bar. The rewriteengine doesn’t need to be activated, hence less memory usage.
If you want the address bar to show something else than what you’re directing them to however, making a RewriteRule is better.[/QUOTE]
Ah, alright. So, let’s say I needed to not only make sure that a user can’t access a directory, but then also rewrite the url, like so:
[QUOTE=simplistik;2337754]Whatever you figured out in the first 20 posts[/QUOTE]
Ok, not to be an **… but, I wouldn’t still be asking you questions if it was figured out. There are two ways of doing this, from what I understand… however, if you could explain what the heck "RewriteCond %{REQUEST_URI} !^/([a-zA-Z0-9-._/])/?" even does… to me, all that looks like it’s doing it checking with a condition for ANY sub-domain name. I need mine to be specific.