?
Solved

301 redirect syntax

Posted on 2015-02-04
4
Medium Priority
?
86 Views
Last Modified: 2015-02-08
Hi,

I am changing website platforms and it appears I will need to be correctly identifying a certain type of URL structure, and redirecting to a new structure, but it's not as simple as what I'm seeing for examples to use in htaccess. In my case, I need to do a couple of things.

I need to change this:

https://www.domain.com/products/category/subcategory/product/154-product-friendly-name

to this:

https://www.domain.com/shop/product-friendly-name

Is there a way to manage this type of redirect using 301?

Thank you

Bill
0
Comment
Question by:billium99
  • 2
  • 2
4 Comments
 
LVL 14

Accepted Solution

by:
Mark Bullock earned 2000 total points
ID: 40590478
Try something like this in httpd.conf with mod_rewrite for Apache:

RewriteEngine on
RewriteRule  ^products/category/subcategory/product/[0-9]+-([^/.]+)  shop/$1  [R=301]

Open in new window


To help debug, you can use RewriteLog, and set RewriteLogLevel high (above 3).
0
 
LVL 1

Author Comment

by:billium99
ID: 40591233
Thanks - this is a WAMP server. Should I be using mod_rewrite or IIS URL rewrite?

Bill
0
 
LVL 14

Expert Comment

by:Mark Bullock
ID: 40591389
IIS has a URL Rewrite module. There is a GUI to import Apache mod_rewrite rules, like the one I wrote above.
0
 
LVL 1

Author Comment

by:billium99
ID: 40597208
Thanks Mark
0

Featured Post

Free Tool: Port Scanner

Check which ports are open to the outside world. Helps make sure that your firewall rules are working as intended.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Most ColdFusion developers get confused between the CFSet, Duplicate, and Structcopy methods of copying a Structure, especially which one to use when. This Article will explain the differences in the approaches with examples; therefore, after readin…
Meet the world's only “Transparent Cloud™” from Superb Internet Corporation. Now, you can experience firsthand a cloud platform that consistently outperforms Amazon Web Services (AWS), IBM’s Softlayer, and Microsoft’s Azure when it comes to CPU and …
Is your data getting by on basic protection measures? In today’s climate of debilitating malware and ransomware—like WannaCry—that may not be enough. You need to establish more than basics, like a recovery plan that protects both data and endpoints.…
In a question here at Experts Exchange (https://www.experts-exchange.com/questions/29062564/Adobe-acrobat-reader-DC.html), a member asked how to create a signature in Adobe Acrobat Reader DC (the free Reader product, not the paid, full Acrobat produ…
Suggested Courses

839 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question