Solved

find and replace used in 301 redirect

Posted on 2014-10-09
1
151 Views
Last Modified: 2014-10-10
I would do this:
RewriteCond %{REQUEST_FILENAME} !-s
RewriteRule ^/category/CR101.html$ /category/CREST-101.html [R=301,nc]

Except I have about 200 pages all the same except the for the number. How can I write a single 301 redirect that will change the CR to CREST- ?
0
Comment
Question by:garysamuels
1 Comment
 
LVL 50

Accepted Solution

by:
Steve Bink earned 500 total points
Comment Utility
Try this:
RewriteCond %{REQUEST_FILENAME} !-s
RewriteRule ^/?category/CR([0-9]+)\.html$ /category/CREST-$1.html [R=301,NC]

Open in new window

0

Featured Post

Why You Should Analyze Threat Actor TTPs

After years of analyzing threat actor behavior, it’s become clear that at any given time there are specific tactics, techniques, and procedures (TTPs) that are particularly prevalent. By analyzing and understanding these TTPs, you can dramatically enhance your security program.

Join & Write a Comment

Suggested Solutions

If you've heard about htaccess and it sounds like it does what you want, but you're not sure how it works... well, you're in the right place. Read on. Some Basics #1. It's a file and its filename is .htaccess (yes, with a dot in the front). #…
This code takes an Excel list of URL’s and adds a header titled “URL List”. It then searches through all URL’s in column “A”, looking for duplicates. When a duplicate is found, it is moved to the top of the list. The duplicate URL’s are then highlig…
Learn how to find files with the shell using the find and locate commands. Use locate to find a needle in a haystack.: With locate, check if the file still exists.: Use find to get the actual location of the file.:
Connecting to an Amazon Linux EC2 Instance from Windows Using PuTTY.

728 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

9 Experts available now in Live!

Get 1:1 Help Now