K
K
khodos_dmitry2020-02-09 15:09:12
htaccess
khodos_dmitry, 2020-02-09 15:09:12

Why is RewriteRule or RewriteCond not working in Wordpress?

RewriteEngine On
RewriteCond %{HTTPS} =off 
RewriteRule (.*) https://%{HTTP_HOST}%{REQUEST_URI} [QSA,L]

#редирект для сэйвов
RewriteCond %{REQUEST_URI} ^s/
#RewriteRule ^(.*)/$ /$1 [R=301]
RewriteRule /s/(.*)$ /wp-content/themes/iconic-one/function/save/index.php?id=$1 [L]

# BEGIN WordPress
<IfModule mod_rewrite.c>
RewriteBase /
RewriteRule ^index\.php$ - [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /index.php [L]
</IfModule>

# END WordPress

there is no redirect from a link like site.ru/s/gram. Writes: Nothing found here!

Answer the question

In order to leave comments, you need to log in

1 answer(s)
D
dodo512, 2020-02-09
@dodo512

RewriteRule /s/(.*)$

The line with which the RewriteRule works does not start with /
https://habr.com/en/company/sprinthost/blog/129560/
RewriteRule ^s/(.*)$ /wp-content/themes/iconic-one/function/save/index.php?id=$1 [L]

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question