Connecting Tech Pros Worldwide Help | Site Map

apache redirect remove part of url

  #1  
Old May 2nd, 2008, 02:17 PM
Newbie
 
Join Date: Feb 2008
Posts: 18
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.
  #2  
Old June 4th, 2009, 09:10 PM
Markus's Avatar
Moderator
 
Join Date: Jun 2007
Location: York, England, with wolves.
Posts: 4,858
Provided Answers: 9

re: apache redirect remove part of url


Quote:
Originally Posted by madshov View Post
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)

Expand|Select|Wrap|Line Numbers
  1. RewriteEngine On
  2.  
  3. RewriteRule ^xxx/yyy$ /yyy [R=301]
  4.  
Read documentation for more information.
Reply


Similar Threads
Thread Thread Starter Forum Replies Last Post
Change request URL bgold12 answers 9 November 14th, 2008 07:15 PM
Large web site, need to do some major rearrangement of files... mike answers 20 January 22nd, 2007 10:05 PM
redirect / new website how to redirect old (google) links to newsite ? John answers 21 November 11th, 2006 03:15 AM
Part of URL is getting discarded Howard Kaikow answers 17 July 23rd, 2005 03:42 PM