B
B
bossigorxxx2021-10-27 11:34:57
htaccess
bossigorxxx, 2021-10-27 11:34:57

How to exclude the main page from the redirect?

I use this code to exclude the redirect of categories and their pagination. How to exclude the main page?

RewriteEngine On
RewriteCond %{HTTP_USER_AGENT} "android|blackberry|googlebot-mobile|iemobile|ipad|iphone|ipod|opera mobile|palmos|webos" [NC]
RewriteCond %{HTTP_HOST} ^example.net$
RewriteCond %{ENV:REDIRECT_STATUS} ^$
RewriteCond %{REQUEST_URI} !^/lechenie-diarei/page/.*$
RewriteCond %{REQUEST_URI} !^/lechenie-diarei$
RewriteCond %{REQUEST_URI} !^/pitanie/page/.*$
RewriteCond %{REQUEST_URI} !^/pitanie$
RewriteCond %{REQUEST_URI} !^/ponos-u-zhivotnyh/page/.*$
RewriteCond %{REQUEST_URI} !^/ponos-u-zhivotnyh$
RewriteCond %{REQUEST_URI} !^/table/lekarstva/page/.*$
RewriteCond %{REQUEST_URI} !^/table/lekarstva$
RewriteRule (.*) https://example-net.turbopages.org/example.net/s/$1 [R=301,L]

<IfModule mod_rewrite.c>
RewriteEngine On
RewriteRule .* - [E=HTTP_AUTHORIZATION:%{HTTP:Authorization}]
RewriteBase /
RewriteRule ^index\.php$ - [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /index.php [L]
</IfModule>


Tried to add like this but didn't work
RewriteCond %{REQUEST_URI} !^/$   и так RewriteCond %{REQUEST_URI} !^/index\.php$

Answer the question

In order to leave comments, you need to log in

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question