Forum Moderators: phranque

Message Too Old, No Replies

Advanced .htaccess 301 redirect

         

archker

8:21 am on Sep 6, 2010 (gmt 0)

10+ Year Member



Hello,

I usually dont mess around in .htaccess much and it's been years since last time.

Back then I had this magical line that "creates" html files out of normal php pages.

RewriteRule ([a-z]+)/art_([a-zA-Z0-9_-]+)\.html$ /picture\.php?album=$1&picture=$2&lang=$3


= art_01.html

Now my problem is that I changed all file-names to:

RewriteRule ([a-z]+)/art_([a-zA-Z0-9_-]+)_([a-zA-Z0-9_-]+)\.html$ /picture\.php?album=$1&picture=$2&lang=$3


= art_namehere_01.html

Which causes issues in google adsense since none of the old pages is there anymore.


I read I have to do a 301 redirect: but how? I cant for example make this work (or variations of it):

Redirect 301 ([a-z]+)/art_([a-zA-Z0-9_-]+)\.html$ ([a-z]+)/art_([a-zA-Z0-9_-]+)_([a-zA-Z0-9_-]+)\.html$

Any suggestions on how to make the redirect work?

archker

7:36 pm on Sep 6, 2010 (gmt 0)

10+ Year Member



Oh well, nevermind, I made a php 301 redirect instead ;)