View Single Post
  #8 (permalink)  
Old 12-04-2008, 06:45 PM
wige's Avatar
wige wige is online now
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

Quote:
Originally Posted by spenland View Post
Great thanks for the tips guys!

AjiNIMC, I have one question about your suggestion. If I want to do as you suggested with this example:

RewriteRule ^/oldfolder/(.*) http://domain.tld/newfolder/$1

what does the '$1' do in this example? Is it a variable of some type? Can I leave it out?

Thanks!
Whatever is in parenthesis in the first section is put into a numbered variable in the destination. So for

RewriteRule /(.*)/(.*).html showpage?subject=$1&article=$2

$1 would correspond to the first .* and $2 would correspond to the second.
__________________
The best way to learn anything, is to question everything.
Reply With Quote