Answer the question
In order to leave comments, you need to log in
How to redirect all requests starting with a prefix to a specific folder?
Hello everyone, and Happy New Year.
I ran into a problem, but my search didn't turn up any results.
A number of wordpress sites and one laravel project are deployed on the server in a separate directory.
The task is that on all these sites it is necessary that when accessing a URL with a certain prefix, a laravel project opens. ( site1.ru/prefix, site2.ru/prefix)
To begin with, I created a symbolic link to the laravel directory.
ln -s /var/www/laravelproject prefix
After that, when you go to siten.ru/prefix, the laravel project actually opens. But with a higher nesting level (siten.ru/prefix/user), this url opens WordPress, and accordingly does not find it, giving 404.
I need absolutely all requests starting with prefix to go to the laravel project.
I also tried to solve the problem through Alias and AliasMatch in the apache config
AliasMatch /prefix/(.*)$ /var/www/laravelproject/$1 - No result at all
Alias /prefix/ /var/www/laravelproject/ - The same result as and in the version with symbolic links
I would be grateful for any help
Answer the question
In order to leave comments, you need to log in
let's decompose and solve this
After that, when you go to siten.ru/prefix, the laravel project actually opens. But with a higher nesting level (siten.ru/prefix/user) this url opens WordPress, and accordingly does not find it, giving 404
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question