-2
I have a. htaccess file with several instructions. I would like to make it more dynamic, that is, make it more optimized for other sites without having to edit it.
Lines like the ones mentioned below refer to the domain name, I would like it to search for the domain name automatically, without the need to quote it.
RewriteCond %{HTTP_HOST} !^www\.
RewriteRule ^(.*)$
http://www.nomedodominio.com.br/diretorio/administrador/$1
[R=301,L]
and
ErrorDocument 404 http://www.nomedodominio.com.br/diretorio/administrador/
Note: I need to keep the path after the domain name: /directory/administrator/.
Thanks in advance.
We have an absurd amount of posts about htaccess on the site, practically covering almost all common situations, it would be good a researched. This is what you want is normal, what is not normal is the domain to be "hardcoded" as in your example (to start the conversation, the lines would not need to have the domain referred).
– Bacco