A
A
Apostrophe42020-02-11 19:20:48
htaccess
Apostrophe4, 2020-02-11 19:20:48

How to redirect the user from the desired section of the site to the main page?

There are a lot of pages. It is necessary that when the user navigates through these pages, he is automatically redirected to index.html
. when a user visits a page that is in the sitemap folder, I want to be redirected to sitemap/index.html
There are a lot of pages manually, I can’t write on each one.
I tried to use the following code, it works, but it redirects to sitemap/index.html from absolutely all pages, but I only need from those that are in the sitemap folder.
Tried to write: RewriteBase sitemap or RewriteBase /sitemap but got 500(th) error.

RewriteEngine On
RewriteBase /
 
RewriteRule ^(.*)$ sitemap/index.html [L,QSA]

5e42d2b8d91ec634852481.png
5e42d2c68f1e4860134030.png

Answer the question

In order to leave comments, you need to log in

1 answer(s)
S
Stalker_RED, 2020-02-11
@Stalker_RED

Set DirectoryIndex

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question