Simple .htaccess - mysite.com/web/ to mysite.com/resources/web/

Discussion in 'Apache' started by BrianM, Jul 15, 2010.

  1. #1
    I have an easy mod_rewrite problem. I say easy because it seems easy, although I have been toying with this for hours. At this point, I just feel like a rookie...

    I need to following URLS to redirect:
    • mysite.com/web
    • mysite.com/web/
    To
    • mysite.com/resources/web/

    Can anyone help me out? I don't understand why this doesn't work...
    RewriteCond %{REQUEST_URI} ^/web$ [NC,OR]
    RewriteCond %{REQUEST_URI} ^/web/$ [NC]
    RewriteRule .* /resources/web/ [R=301,L]
    Code (markup):

     
    BrianM, Jul 15, 2010 IP
  2. nimonogi

    nimonogi Active Member

    Messages:
    398
    Likes Received:
    3
    Best Answers:
    1
    Trophy Points:
    80
    #2
    Not tested but should work:
    
    RedirectMatch 301 ^/web$ http://www.mysite.com/resources/web/
    
    Code (markup):
     
    nimonogi, Jul 17, 2010 IP