1

I create a new website. In the old one I had the url to an article like:

www.mysite.com/article,{article_id},{article_title}.html 

I want to change the structure of my url in cakephp without losing my SEO position in google. How can I do it ?

I use Cakephp 3.8 I haven't tried anything yet because I don't know where to start

ndm
  • 59,784
  • 9
  • 71
  • 110
Matthew
  • 11
  • 1

1 Answers1

0

Assuming you are using an apache webserver, I'd set 301 redirects in the htaccess to tell the robot the old URLs are moved permanentely.

This shouldn't affect SEO as it is a standard procedure.

Depending on how your new URL format looks like, you can then use a query-string for dynamic urls like so:

RewriteEngine On
RewriteBase /

RewriteCond %{QUERY_STRING} !^article,.+ [NC]
RewriteRule ^(.+?)/([^/]+)/?$ $1/?article,$2 [L,QSA]
Jonathan
  • 1,955
  • 5
  • 30
  • 50