D
D
devKazhan2016-11-23 12:55:25
htaccess
devKazhan, 2016-11-23 12:55:25

How to make a 301 redirect from a URL and its subsequent pages to another one?

I'm trying to redirect from one category and all its attachments to one page, but the redirect leads to 404, because I need to add an attachment to the end of the page

RewriteCond %{REQUEST_URI} ^/testimony/$
RewriteRule ^.*$ http://mydoman.com/testimonials.html? [R=301,L]

result : mydoman/testimonials.htmluser-demo

Answer the question

In order to leave comments, you need to log in

1 answer(s)
D
devKazhan, 2016-11-23
@devKazhan

Thank you! Figured it out myself
# BEGIN WordPress
RewriteEngine On
RewriteBase /
RewriteCond %{REQUEST_URI} ^/testimony
RewriteRule ^.*$ /testimonials.html [R=302,L]
RewriteRule ^index\.php$ - [L]
RewriteCond %{REQUEST_FILENAME} ! -f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /index.php [L]
# END WordPress

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question