WebFaction
Community site: login faq

Hey, folks. I have the following in a .htaccess file:

RewriteCond %{HTTP_HOST} example\.com$ [NC]
RewriteCond %{REQUEST_URI} ^/(clients|demos|news|party|index.shtml|index-old.shtml)(.*)$
RewriteRule ^(.*)$ http://old.example.com/$1 [R=301,L]

It's currently matching "/newsletter" as well as "/news". How can I make it match only "news"?

Thanks in advance!

asked 27 Mar '13, 01:38

tgeller
16124
accept rate: 50%


I got the answer from IRC! It was simple: Removed the (.*) from the end of the second line, to wit:

RewriteCond %{HTTP_HOST} example\.com$ [NC]
RewriteCond %{REQUEST_URI} ^/(clients|demos|news|party|index.shtml|index-old.shtml)$
RewriteRule ^(.*)$ http://old.example.com/$1 [R=301,L]
permanent link

answered 27 Mar '13, 02:43

tgeller
16124
accept rate: 50%

Your answer
toggle preview

Follow this question

By Email:

Once you sign in you will be able to subscribe for any updates here

By RSS:

Answers

Answers and Comments

Markdown Basics

  • *italic* or _italic_
  • **bold** or __bold__
  • link:[text](http://url.com/ "title")
  • image?![alt text](/path/img.jpg "title")
  • numbered list: 1. Foo 2. Bar
  • to add a line break simply add two spaces to where you would like the new line to be.
  • basic HTML tags are also supported

Question tags:

×225
×75
×4

question asked: 27 Mar '13, 01:38

question was seen: 11,196 times

last updated: 27 Mar '13, 02:43

WEBFACTION
REACH US
SUPPORT
AFFILIATE PROGRAM
LEGAL
© COPYRIGHT 2003-2019 SWARMA LIMITED - WEBFACTION IS A SERVICE OF SWARMA LIMITED
REGISTERED IN ENGLAND AND WALES 5729350 - VAT REGISTRATION NUMBER 877397162
5TH FLOOR, THE OLD VINYL FACTORY, HAYES, UB3 1HA, UNITED KINGDOM