Answer the question
In order to leave comments, you need to log in
How to hide source path after URL rewrite?
All files on the server are stored in the root, in the /apps/sitename.ru/ folder. By default, they all open in the usual way, that is, the www.sitename.ru/i/logo.png page opens the /apps/sitename.ru/i/logo.png file. If the file does not exist, processing is transferred to the controller.
I am using the following rules:
RewriteCond %{DOCUMENT_ROOT}/apps/sitename\.ru/%{REQUEST_URI} -f
RewriteRule ^(.*)$ apps/sitename\.ru/$1 [NC,QSA,L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^(.*)$ index.html?_action=$1 [QSA,L]
Answer the question
In order to leave comments, you need to log in
I would not have done this:
in .htaccess I would have registered that all requests to the address: www.sitename.ru/apps/*
would go to a handler file that could do a redirect or something else.
And the second file would be processed from the root or from the /i/ folder, depending on what you have as the root for processing.
And for all requests, I checked whether there is a file at the local address: www.sitename.ru/apps/sitename.ru/i/logo.png and would display its content in the browser.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question