I want to create a sort of wildcard to redirect to a new url.
I replaced a specific part, that should be redirected.
All url's that contain the following /computers/notebooks-laptops/
Should be redirect to /computers/laptops/
So the following URL
https://www.example.com/computers/notebooks-laptops/product1
should become:
https://www.example.com/computers/laptops/product1
How can I achieve that?
I am assuming you are using the .htaccess
in root directory, use below rule.
RewriteEngine On
RewriteCond %{REQUEST_URI} ^/computers/notebooks-laptops/(.*)
RewriteRule ^ /computers/laptops/%1 [R=301,L]
Collected from the Internet
Please contact [email protected] to delete if infringement.
Comments