O
O
Obivankinobi2017-08-28 22:44:07
Apache HTTP Server
Obivankinobi, 2017-08-28 22:44:07

How to configure htaccess correctly if RewriteBase is used?

Good evening!
I've got a problem that I can't solve. At the root of the site is htaccess and it redirects to the version without www.

RewriteBase / 
RewriteCond %{HTTP_HOST} ^www\.(.*)$
RewriteRule ^(.*)$ http://%1/$1 [L,R=301]

And everything seems to be fine, but one directory has its own htaccess that does not redirect to the version without www.
And I can’t defeat him in any way ..... Help me understand how ..
RewriteEngine On 
  RewriteBase /gallery 
  RewriteCond %{REQUEST_FILENAME} -f [OR]
  RewriteCond %{REQUEST_FILENAME} -d
  RewriteRule ^.*$ - [L]
  RewriteRule ^.*/?$                        index.php [L,QSA]

Answer the question

In order to leave comments, you need to log in

1 answer(s)
V
Viktor Taran, 2017-09-16
@shambler81

rewrite base should not interfere
well, just put your redirect to www at the beginning of the file

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question