S
S
system-shock2015-12-16 11:05:46
htaccess
system-shock, 2015-12-16 11:05:46

How to make an absolute file path redirect rule in htaccess?

I wanted to place several folders with my projects on the domain. It looks like this:
www.domain.ru/project1/
www.domain.ru/project2/
etc.
But in each of the projects all files (images, js, css) are connected using absolute paths.
And a problem arises when I access www.domain.ru/project1/ then all files are searched at the root, i.e. in www.domain.ru/
I can’t figure out how to redirect all these files using a rule in htaccess so that the folder in which the project is located was considered the root (for project 1, the root would be www.domain.ru/project1/, etc.)

Answer the question

In order to leave comments, you need to log in

1 answer(s)
E
eSelf, 2015-12-16
@eSelf

You can specify the base tag in each of the projects
htmlbook.ru/html/base

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question