i have changed in the seo_url.php the folowing line.
from:
$url .= '/' . $query->row['keyword'];
to:
$url = '/' . $query->row['keyword'];
so if i click on a link on the website i always got the main url like
instead of https://www.site.de/category/subcategory/product
my problem is, that google has still the old url (https://www.site.de/category/subcategory/product)
if i type https://www.site.de/category/subcategory/product in the url i want it to change to https://www.site.de/product
How can I achieve this?
You should use this https://websiteadvantage.com.au/HtAccess-301-Redirect-Generator tool to create the redirects with 301 Moved Permanently all the URL you would like to change. Then add these redirects to your's site root /.htaccess
file.
Example:
RewriteEngine On
RewriteCond %{QUERY_STRING} ^$
RewriteRule ^category/subcategory/product$ /product? [R=301,NE,NC,L]
Also you should submit a new sitemap.xml
file to Google Search Console https://search.google.com/search-console/about.