apache redirect remove part of url

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • madshov
    New Member
    • Feb 2008
    • 20

    apache redirect remove part of url

    How do make a redirect of the following example:

    www.test.com/xxx/yyy -> www.test.com/yyy

    In other words I would to always remove xxx from the url.
    I'm sure it's really straight forward, but I'm not very experienced with Apache.
  • Markus
    Recognized Expert Expert
    • Jun 2007
    • 6092

    #2
    Originally posted by madshov
    How do make a redirect of the following example:

    www.test.com/xxx/yyy -> www.test.com/yyy

    In other words I would to always remove xxx from the url.
    I'm sure it's really straight forward, but I'm not very experienced with Apache.
    Something like this (.htaccess file)

    Code:
    RewriteEngine On
    
    RewriteRule ^xxx/yyy$ /yyy [R=301]
    Read documentation for more information.

    Comment

    Working...