How to fix resource file path after using htaccess

When a browser is displayed:

http://example.com/first/second

and encounters a relative URL, for example:

<img src="site/images/photo.png">

Translates relative URL (respectively):

http://example.com/first/second/site/images/photo.png

so the solution

-1
source share
1 answer

Try adding the code just below the line RewriteEngine On

RewriteCond %{REQUEST_FILENAME} !-f

You can also add the following to <head>, which may work.

<base href="http://www.example.com/" />
+1
source

Source: https://habr.com/ru/post/1794977/


All Articles