W
W
websiller2018-09-25 11:15:50
htaccess
websiller, 2018-09-25 11:15:50

How to set up a redirect to another page, but with the same address in the url in .htaccess?

There is such htaccess (wordpress):

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

We need a rule under which, if the url contains such a piece "/new-posts/", then you need to redirect to a specific page, and so that the url does not change.
For example, the url that the user goes to example.ru/new-posts/lala should redirect to the page example.ru/custom, but the original address should remain in the url - example.ru/new-posts/lala. So far I have only redirected, but with a change in url

Answer the question

In order to leave comments, you need to log in

1 answer(s)
D
Dimonchik, 2018-09-25
@dimonchik2013

https://stackoverflow.com/questions/14895980/htacc...

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question