L
L
luckystrike9032014-04-04 10:22:14
htaccess
luckystrike903, 2014-04-04 10:22:14

How to change the link structure when moving to a new domain?

Faced a problem.
Site on Wordpress. Recently moved to a new domain and at the same time changed the link structure itself.
It was: olddomain.ru/%category%/%postname%/
And it became: newdomain.ru/%year%/%month%/%postname%/ Registered
301 redirects for gluing domains and redirecting to new addresses, but when switching to old The redirect doesn't fully work for links, the links like olddomain.ru/%year%/%month%/%postname%/ are obtained. The
links were specially written with wordpress tags to make it clearer. I use real links in htaccess on the site.
I've been struggling with htaccess for two days and I can't figure out what's wrong. Here is an example of a redirect:

RewriteCond %{HTTP_HOST} ^www\.newdomain\.ru$
RewriteRule ^/?(.*)$ "http\:\/\/newdomain\.ru\/$1" [R=301,L]
RewriteCond %{HTTP_HOST} ^olddomain\.ru$ [OR]
RewriteCond %{HTTP_HOST} ^www\.olddomain\.ru$
RewriteRule ^/?(.*)$ "http\:\/\/newdomain\.ru\/$1" [R=301,L]

Redirect 301 /%category%/%postname%/ http://newdomain.ru/%year%/%month%/%postname%/

Tell me what am I doing wrong?

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