View Single Post
  #2 (permalink)  
Old 12-01-2008, 11:18 AM
wige's Avatar
wige wige is offline
Moderator
WebProWorld Moderator
 
Join Date: Jun 2006
Location: United States
Posts: 2,648
wige RepRank 9wige RepRank 9wige RepRank 9wige RepRank 9wige RepRank 9wige RepRank 9wige RepRank 9wige RepRank 9wige RepRank 9wige RepRank 9wige RepRank 9
Default Re: Need help with 301 redirect and mod_rewrite

An entire folder can be redirected rather easily. For example, to redirect domain.tld/oldfolder/file.html to domain.tld/newfolder/file.html, you would use the following code in your .htaccess file:
Code:
RedirectMatch ^/oldfolder/(.*) http://domain.tld/newfolder/$1
I am not sure, however, if that will properly redirect query strings as well. If it doesn't, you may need to use mod_rewrite.
__________________
The best way to learn anything, is to question everything.
Reply With Quote