S
S
sstars2018-02-03 14:04:33
Apache HTTP Server
sstars, 2018-02-03 14:04:33

How to create a proper internal redirect?

The essence of this is to do an internal redirect at the site.ru/name_folder/ request to load the content from site.ru/myfolder/name_folder/. There is a ready htaccess
RewriteCond %{REQUEST_URI} !^/index.html$
RewriteRule ^(.+)$ /myfolder/$1 [L]
It works, but when we request a page without a slash at the end of site.ru/name_folder, it redirects to the page site.ru/myfolder/name_folder/, but you need to stay on the page site.ru/name_folder/

Answer the question

In order to leave comments, you need to log in

1 answer(s)
S
sstars, 2018-02-03
@sstars

Solved by enabling
RewriteOptions AllowNoSlash

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question