[ URL Rewrite Rule (subfolder .htaccess) ]
I have this .htaccess file
domain.com/modules/mymodule/.htaccess
can this htaccess file "handle" urls like domain.com/something
i cannot put or edit a .htaccess on the root directory, i can only put it in mymodule subfolder
i don't want the user to see
domain.com/modules/mymodule/mymodulepage
but something like
domain.com/mymodulepage
can this be done ?
i posted nothing that i tried because they were just desperate attempts such as playing with RewriteBase and so on .. but i knew that the url is not getting "handled" by the subfolder's htaccess file !!
Answer 1
can this htaccess file "handle" urls like domain.com/something
No it can't. It won't be accessed unless the request is for something in that directory or its subdirectories.
You can make domain.com/modules/mymodule/mymodulepage
redirect to domain.com/mymodulepage
, but once it's there, you won't have any rules to property handle it.
If you have no access to any kind of server config except an htaccess file in /modules/mymodule/
, you're not going to be able to do this. If you do have access to some level of config, you could do something like this:
Alias /mymodulepage /the/path/to/modules/mymodule/
And that will point the URI /mymodulepage
to the file-path /the/path/to/modules/mymodule/
where the URI /modules/mymodule/
is.