A
A
Asya2019-03-17 15:06:44
Denver
Asya, 2019-03-17 15:06:44

How to change root directory in .htaccess?

on Denver, in the localhost/www/ folder, there is mysite.com/index.php5 in the same place mysite.com/about.php5
in the index , the link to about is indicated like this "/about"
but instead of going to localhost/mysite.com /about it redirects to localhost/about
how to fix this?
in .htaccess I tried to write this:

DirectoryIndex index.php5
RewriteEngine on
RewriteBase /mysite.com/
RewriteCond %{THE_REQUEST} ^[A-Z]{3,9}\ /([^.]+)\.php5\ HTTP
RewriteRule ^([^.]+)\.php5$ mysite.com\$1 [R=301,L]
RewriteCond %{REQUEST_URI} !(\.[^./]+)$
RewriteCond %{REQUEST_fileNAME} !-d
RewriteCond %{REQUEST_fileNAME} !-f
RewriteRule (.*) /$1.php5

Answer the question

In order to leave comments, you need to log in

1 answer(s)
V
Viktor Taran, 2019-03-20
@shambler81

rather, you are using the localhost folder in Denver, although in theory it was necessary to create a folder with the site and write it in the host file.
In this case, there will be a correct domain.
There will be no such crap in production.
in general it is better to use openserver.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question