S
S
Stalkerus2021-02-11 18:13:28
htaccess
Stalkerus, 2021-02-11 18:13:28

How to fix fancy stuff in .htaccess?

Hello!
I needed a link like /wp-content/themes/olmerk/rus.php to be replaced with /rus
. I got to the point that now this link does not work at all. I put the following in htaccess:

RewriteEngine On

RewriteCond %{THE_REQUEST} "/wp-content/themes/olmerk/rus.php" 
RewriteRule ^  http://mysite.eu/rus [R=301,L]

RewriteCond %{DOCUMENT_ROOT}/wp-content/themes/olmerk/rus.php -f
RewriteRule ^([^/]+)$  /rus [L]

Options +MultiViews


Actually, the question is how to fix the tricked-out and come to the original goal, i.e. mysite.eu/rus?

Answer the question

In order to leave comments, you need to log in

2 answer(s)
V
Viktor Taran, 2021-02-11
@shambler81

RewriteEngine On
RewriteRule ^wp\-content/themes/olmerk/rus\.php$ /rus? [L,R=301]

S
Stalkerus, 2021-02-11
@Stalkerus

On this

RewriteEngine On

RewriteCond %{THE_REQUEST} "/wp-content/themes/olmerk/rus.php" 
RewriteRule ^  http://mysite.eu/rus [R=301,L]

RewriteRule ^rus$ /wp-content/themes/olmerk/rus.php [L]

shows the end result mysite.eu/rus and gives "page not found".
I'm running openserver, although that doesn't seem to have any effect.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question