S
S
Sergey Korenevsky2020-04-24 18:21:28
Apache HTTP Server
Sergey Korenevsky, 2020-04-24 18:21:28

How to change absolute to alias path in Apache, .htaccess?

Dear Professionals and Guru of the code, give advice please.
The command __DIR__(PHP) returns a path like "c:/server/projects/localhost/joomla/" after installing dozens of projects in a folder. Each project is configured with a PC drive path. If I transfer the project to another server installed in another logical drive, or give the project to a colleague who, of course, also has the server installed in another logical drive and in another folder. Then the project and the modules in the projects need to be reconfigured. It is required that __DIR__it returns some alias __SERVER\localhost\joomla\ and not a path on the disk, so that the projects are not hard-coded to the computer on which the server is installed.
Questions why this is necessary are not accepted

Answer the question

In order to leave comments, you need to log in

1 answer(s)
V
Viktor Taran, 2020-04-24
@shambler81

1 I would advise you to abandon the "c:/server/projects/localhost/joomla/" server,
especially since there are wonderful things like openserver
2. there are many options, for example, Basedir in .htaccess
3. through apache
4. most likely this will suit you, there are relative and absolute paths
https://www.uamedwed.com/blog/web/absolyutnyj-i-ot...
just don't forget that the protocol can now be different, so //
and lastly ,
this is from the paragraph 1 should
have symlink and relative symlink in linux

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question