У меня есть общий хостинг на A2Hosting, и я недавно переместил свой основной домен с public_html/
на public_html/subdir/
Вот структура:
/public_html
/subdir(site files of main domain)
/api
index.php
Мой текущий htaccess (public_html)это:
RewriteEngine on
RewriteBase /
RewriteCond %{REQUEST_URI} !^/subdir/
RewriteCond %{HTTP_HOST} ^(www\.)?domain\.
RewriteRule ^(.*)$ /subdir/$1 [L]
Когда я вызывал свой APi, прежде чем он был: domain.com/api/
Но теперь это: domain.com/subdir/api/
Мой htaccess в api
это:
RewriteEngine On
RewriteBase /api/
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^ index.php [QSA,L]
Как убрать «subdir» в URL, чтобы сохранить мой API как и предыдущий?Но все еще указываете root на мой subdir с моим текущим htaccess?
Спасибо