0

I am in the process of redirecting outdated URLs to their new URL.

I dynamically generate the product page URLs using the following three RewriteRules:

# PRODUCT SUB-CATEGORY REDIRECT -- Must follow syntax: domain.com/products/CATEGORY/SUB-CATEGORY
RewriteRule ^products/([^/]*)/([^/]*)$ /product-subcategory.php?category=$1&sub-category=$2 [QSA,NC,L]

# PRODUCT CATEGORY REDIRECT -- Must follow syntax: domain.com/products/CATEGORY
RewriteRule ^products/([^/]*)$ /product-category.php?category=$1 [QSA,NC,L]

# PRODUCT CATEGORY REDIRECT WITH PAGE NUMBER
RewriteRule ^products/([^/]*)/page/([^/]*)$ /product-category.php?category=$1&page=$2 [QSA,NC,L]

The above methods work correctly.

Now, I am trying to redirect the old URL structure shown here:

http://example.com/company/categories.cfm?c=Standard_Cabinet

To the new page, shown here:

http://example.com/products/standard-cabinets

I tried this RewriteRule, with no success:

RewriteRule ^company/categories.cfm?c=Standard_Cabinet$ http://www.example.com/products/standard-cabinets [R=301,NC]

I just keep getting redirected to my 404 page. I do not need to keep the old URL parameters

1 Answer 1

1

Use that:

RewriteCond %{QUERY_STRING} ^c=Standard_Cabinet$ [NC]
RewriteRule ^company/categories\.cfm$ http://www.example.com/products/standard-cabinets? [R=301,NC]
Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.