.ht access RewriteRule Question

Discussions about Apache mod Rewrite, .htaccess, Use, experiences ... URL Rewriting.

Moderator: Moderators

.ht access RewriteRule Question

Postby theboxinghistorian » Tue Mar 30, 2010 5:59 pm

Hi there I am looking to create my first Re Write Rule. My news articles where released into Google news, all the articles where stored in a “news” folder. I have now added sub folders “009” and “010”. I now need to delete the sub folders “009” and “010” from appearing in the URL. As Google is directed to the news folder and not sub folders.
Example URL http://www.theboxinghistorian.com/news/ ... irrell.php
What I am looking for is to eliminate the folder 010 from appearing in the URL.

I have tried and below is the code i came up with, although it never worked. Any help or information would be greatly appreciated.

# Eliminate sub folders
RewriteCond %{DOCUMENT_ROOT}/news/010/$0 -f
RewriteRule ^[^/]+\.html$ /news/010/$0 [QSA,L]
Posts: 1
Joined: Tue Mar 30, 2010 5:50 pm


Return to Apache mod Rewrite


  • Related topics
    Last post

Who is online

Users browsing this forum: No registered users and 1 guest