help required with Rewrite Rule

Ye' old general discussion board. Basically, for everything that isn't covered elsewhere. Come here to shoot the breeze, shoot your mouth off, or whatever suits your fancy.
This forum is not for asking programming related questions.

Moderator: General Moderators

Post Reply
theboxinghistorian
Forum Newbie
Posts: 4
Joined: Sat Jan 02, 2010 9:03 am

help required with Rewrite Rule

Post by theboxinghistorian »

Hi, I am trying to eliminate a folder from appearing in my URL. I done this months ago but no longer have the code.

Example
I am trying to eliminate the folder named "2009" from appearing in the URL. At the moment the path reads
http://www.theboxinghistorian.com/news/ ... -2010.html

I am looking for it to read.
http://www.theboxinghistorian.com/news/ ... -2010.html

As I said I had this working weeks ago but missplaced the code, I have been trying the following Rewrite rule

#Check inf the file exists in /news/2009.
RewriteCond%{DOCUMENT_ROOT}/news/2009/$09 -f
RewriteRule ^[^/]+\.html$ /news/2009/$0 [QSA.L]
Post Reply