?
Solved

301 redirect syntax

Posted on 2015-02-04
4
Medium Priority
?
84 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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

Building an interactive eFuture classroom

Watch and learn how ATEN provided a total control system solution including seamless switching matrix switch, HDBaseT extenders, PDU, lighting control to build an interactive eFuture classroom.

Question has a verified solution.

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

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 …
What You Need to Know when Searching for a Webhost Provider
Michael from AdRem Software explains how to view the most utilized and worst performing nodes in your network, by accessing the Top Charts view in NetCrunch network monitor (https://www.adremsoft.com/). Top Charts is a view in which you can set seve…
Visualize your data even better in Access queries. Given a date and a value, this lesson shows how to compare that value with the previous value, calculate the difference, and display a circle if the value is the same, an up triangle if it increased…
Suggested Courses

777 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