Answer the question
In order to leave comments, you need to log in
How to configure .htaccess to hide value in address bar?
Tell me please!
There is a website at mysite.ru/~ih123456/shop/.
On the server in /home/ih123456/public_html is .htaccess.
CMS Prestashop itself is installed in /home/ih123456/public_html/shop
File contents: .htaccess
RewriteEngine on
RewriteCond %{HTTP_HOST} ^mysite\.ru$ [OR]
RewriteCond %{HTTP_HOST} ^www\.mysite\.ru$
RewriteRule ^ /?$ "http\:\/\/mysite\.ru\/mysite" [R=301,L]
301 redirect was made so that when you enter mysite.ru in the address bar, the address mysite.ru/~ih123456/ opens shop/ with a deployed CMS, without this redirect, the mysite.ru address was opened, in which there was a shop directory, when clicked, mysite.ru/~ih123456/shop/ was opened and the CMS was launched.
The question is, how can I hide the value "/~ih123456/shop/" in the address bar when surfing the site?
Answer the question
In order to leave comments, you need to log in
I think something like this:
RewriteRule ^~ih123456/shop/$ http://%{HTTP_HOST}/shop/ [R=301,L]
RewriteRule ^shop/$ /~ih123456/shop/ [L]
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question