homepage Welcome to WebmasterWorld Guest from
register, free tools, login, search, pro membership, help, library, announcements, recent posts, open posts,
Become a Pro Member
Home / Forums Index / Code, Content, and Presentation / Apache Web Server
Forum Library, Charter, Moderators: Ocean10000 & incrediBILL & phranque

Apache Web Server Forum

proper format for RedirectPermanent
several pages pointing to 1 page

10+ Year Member

Msg#: 5002 posted 7:06 pm on Nov 14, 2005 (gmt 0)

What is the correct format to point several pages on the same domain to one page in the .htaccess file. Can it all be done on one RedirectPermanent line or will it take several. Is this correct :

RedirectPermanent /old page-1.html /old page-2.html http://example.com/new-page.html


RedirectPermanent /old page-1.html http://example.com/new-page.html

RedirectPermanent /old page-2.html http://example.com/new-page.html

[edited by: jdMorgan at 1:32 pm (utc) on Nov. 15, 2005]
[edit reason] Example.com [/edit]



WebmasterWorld Senior Member jdmorgan us a WebmasterWorld Top Contributor of All Time 10+ Year Member

Msg#: 5002 posted 1:31 pm on Nov 15, 2005 (gmt 0)

You'll need to list them out, as in your second example.

However, if these old pages' URL-paths have a lot in common, then look into using RedirectMatch, with which you can use regular expressions pattern-matching to match more than one URL-path.

For a simple example:

RedirectMatch 301 ^/old-page-[12]\.html$ http://example.com/new-page.html


Global Options:
 top home search open messages active posts  

Home / Forums Index / Code, Content, and Presentation / Apache Web Server
rss feed

All trademarks and copyrights held by respective owners. Member comments are owned by the poster.
Home ¦ Free Tools ¦ Terms of Service ¦ Privacy Policy ¦ Report Problem ¦ About ¦ Library ¦ Newsletter
WebmasterWorld is a Developer Shed Community owned by Jim Boykin.
© Webmaster World 1996-2014 all rights reserved