Welcome to WebmasterWorld Guest from 54.198.106.21

Forum Moderators: Ocean10000 & incrediBILL & phranque

Redirect old url's

Redirect old url's

     
2:02 pm on Jun 22, 2017 (gmt 0)

New User

joined:June 22, 2017
posts: 2
votes: 0


Hello.
Due to migration to the new cms, it became necessary to redirect old URLs. When redirecting, it's enough to use part of the URL. For example, the necessary part of URL site.com/p3660664-shtangentsirkul-shts.html is only /p3660664-
Redirect 301 /p3660664-(.*) /index.php?route=product/product&path=530869&product_id=3660664
RewriteCond %{QUERY_STRING} ^route=product/product&path=530869&product_id=3660664$
RewriteRule ^index\.php /p3660664-shts-shtangentsirkul? [R=301,L]

Using this method, the result was not achieved. CMS - opencart.

What am I doing wrong and how do I fix it please ?

Thanks very much
4:32 pm on June 22, 2017 (gmt 0)

Senior Member from US 

WebmasterWorld Senior Member lucy24 is a WebmasterWorld Top Contributor of All Time 5+ Year Member Top Contributors Of The Month

joined:Apr 9, 2011
posts:13841
votes: 485


What am I doing wrong

The blatant big mistake is combining mod_alias (Redirect by that name) with mod_rewrite. You have no control over which module executes first (ordinarily it's mod_rewrite) so your first step is to change all existing mod_alias directives to use mod_rewrite syntax.

(Would Redirect 301 followed by a Regular Expression even work? Best case, the (.*) would be interpreted as a literal string, so the rule will simply fail to execute, ever.)

Start by reading some of the existing posts in this thread, and maybe anything linked from the forum library.
12:22 am on June 23, 2017 (gmt 0)

Administrator

WebmasterWorld Administrator phranque is a WebmasterWorld Top Contributor of All Time 10+ Year Member Top Contributors Of The Month

joined:Aug 10, 2004
posts:10888
votes: 72


welcome to WebmasterWorld, izilus! [webmasterworld.com]

it appears to me you have a situation with old external urls that were being internally rewritten to an index.php script and now the old external urls must be redirected to the new external urls.
in order to help we need to understand the patterns of all 3 sets of urls and how they relate.
9:56 am on June 23, 2017 (gmt 0)

New User

joined:June 22, 2017
posts:2
votes: 0


Thanks to all, I solved my problem this way
RedirectMatch permanent /p503947-(.*).(?:htm|html) /index.php?route=product/product&path=416699&product_id=503947
 

Join The Conversation

Moderators and Top Contributors

Hot Threads This Week

Featured Threads

Free SEO Tools

Hire Expert Members