Need help with simple Mod Rewrite in instance of URL typo

Discussion in 'Apache' started by 2blind2c#, Apr 8, 2009.

  1. #1
    2blind2c#, Apr 8, 2009 IP
  2. norbert

    norbert Guest

    Messages:
    61
    Likes Received:
    2
    Best Answers:
    0
    Trophy Points:
    0
    #2
    (not tested)

    This is a rewrite for a single file
    
    RewriteCond %{HTTP_HOST} www\.domain\.com [NC]
    RewriteRule ^subdirs/main-article$ /subdir/main-article [R=301,L]
    
    Code (markup):
    If you want to rewrite the path and ALL subdirs and files then the following could help:
    
    RewriteCond %{HTTP_HOST} www\.domain\.com [NC]
    RewriteRule ^subdirs/main-article/(.*)$ /subdir/main-article/$1 [R=301,L]
    
    Code (markup):
     
    norbert, Apr 8, 2009 IP