Solved

301 redirect syntax

Posted on 2015-02-04
4
73 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 13

Accepted Solution

by:
Mark Bullock earned 500 total points
Comment Utility
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
Comment Utility
Thanks - this is a WAMP server. Should I be using mod_rewrite or IIS URL rewrite?

Bill
0
 
LVL 13

Expert Comment

by:Mark Bullock
Comment Utility
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
Comment Utility
Thanks Mark
0

Featured Post

Scale it in WD Gold

With up to ten times the workload capacity of desktop drives, WD Gold hard drives employ advanced technology to deliver among the best in reliability, capacity, power efficiency and performance.

Join & Write a Comment

Have you ever sent email via ColdFusion and thought of tracking this mail to capture the exact date and time when the message was opened ?  If yes, then this article is for you ! First we need a table user_email with columns user_id , email , sub…
Introduction This article explores the design of a cache system that can improve the performance of a web site or web application.  The assumption is that the web site has many more “read” operations than “write” operations (this is commonly the ca…
It is a freely distributed piece of software for such tasks as photo retouching, image composition and image authoring. It works on many operating systems, in many languages.
Internet Business Fax to Email Made Easy - With eFax Corporate (http://www.enterprise.efax.com), you'll receive a dedicated online fax number, which is used the same way as a typical analog fax number. You'll receive secure faxes in your email, fr…

763 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

Need Help in Real-Time?

Connect with top rated Experts

6 Experts available now in Live!

Get 1:1 Help Now