I am struggeling with something I am trying to do regarding folder. I have a sub-folder called "admin" so I can access the site as mydomain.com/admin.
However I want that if I say mydomain.com/foobar or mydomain.com/28y282djdhjd, then it should always assume it is "admin".
Of course the rule should not apply to existing files and folders but it is specifically to the first folder from the domain root.
It's as if I want the admin to be accessed no matter what I call it (as long as it is not a physical folder or file)...
I am not good with htaccess if someone could guide me I would truly appreciate it.
So, you need to:
If that's all correct, something like this should do it:
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^([^\/]*)\/?$ http://example.com/admin [L]