I have files in /directory/subdirectory and I’d like it to appear to users that they’re in /directory.
Here’s what I have in my .htaccess file at the moment (returns 500 error):
RewriteEngine on
RewriteRule ^directory/(.*) directory/subdirectory/$1 [NC,L]
I know that rewritebase could accomplish this if my files were in the root www directory but I can’t do that for this project.
Any ideas?
Thanks!
You need to add
[NC,L]at the end of your rewriterule line. NC indicates that this rule is case insensitive, and L indicates Last, that’s where the engine stops processing the rules.For more info visit ModRewrite cheatsheet