"I'm afraid I don't understand the problem very well. I think you want to change .../archives/01_article_name.html to archive01.html"
1. original articles were /archives/01_file_name.html
problem duplicate content from variations on that url, i.e.,
/archives/01.html etc
2. solution change .htaccess to make all article urls
article1.html
3. problem all the old
/archives/01_article_name.html articles are still on the site creating even more duplicate content problems
4. solution - need to redirect all the articles in the /archives/ to the new url
the solution you suggested
RedirectMatch 301 archives/([0-9]+)[A-Za-z0-9/.]*
http://domain.com/article$1.html
gave the same results as my redirect
RedirectMatch 301 archives/([0-9]+)
http://domain.com/article$1.html
it works except all the articles now go to article1.html?url=/archive
the second solution you offered
RedirectMatch 301 archives/([0-9]+)[A-Za-z0-9/]*\.html
http://domain.com/article$1.html
does nothing...the old article urls still show up.
At issue is the fact that I don't know why the query string ?url=/archive is appended to every redirect
the only thing I can see that is related is a similar rewrite rule:
RewriteRule ^archive/? index.php?url=/archive [L,QSA]
My .htaccess looks like
# BEGIN s9y
ErrorDocument 404 /index.php
ErrorDocument 410 /error1.php
DirectoryIndex /index.php
php_value session.use_trans_sid 0
php_value register_globals off
Options +FollowSymlinks
RewriteEngine On
RewriteCond %{HTTP_HOST} ^www\.domain\.com
RewriteRule ^(.*)$
http://domain.com/$1 [R=301,L]
RewriteBase /
RewriteRule ^(article([0-9]+)\.html$) index.php?/$1 [L,QSA]
RewriteRule ^(authors/([0-9]+)-[0-9a-z\.\_!;,\+\-]+) index.php?/$1 [L,QSA]
RewriteRule ^(feeds/categories/([0-9;]+)-[0-9a-z\.\_!;,\+\-]+\.rss) index.php?/$1 [L,QSA]
RewriteRule ^({PAT_PERMALINK_FEEDAUTHORS}) index.php?/$1 [L,QSA]
RewriteRule ^(categories/([0-9;]+)-[0-9a-z\.\_!;,\+\-]+) index.php?/$1 [L,QSA]
RewriteRule ^archives([/A-Za-z0-9]+)\.html index.php?url=/archives/$1.html [L,QSA]
RewriteRule ^([0-9]+)[_\-][0-9a-z_\-]*\.html index.php?url=$1-article.html [L,NC,QSA]
RewriteRule ^feeds/(.*) index.php?url=/feeds/$1 [L,QSA]
RewriteRule ^unsubscribe/(.*)/([0-9]+) index.php?url=/unsubscribe/$1/$2 [L,QSA]
RewriteRule ^approve/(.*)/(.*)/([0-9]+) index.php?url=approve/$1/$2/$3 [L,QSA]
RewriteRule ^delete/(.*)/(.*)/([0-9]+) index.php?url=delete/$1/$2/$3 [L,QSA]
RewriteRule ^(admin|entries)(/.+)? index.php?url=admin/ [L,QSA]
RewriteRule ^archive/? index.php?url=/archive [L,QSA]
RewriteRule ^(index|atom[0-9]*|rss|b2rss|b2rdf).(rss|rdf|rss2|xml) rss.php?file=$1&ext=$2
RewriteRule ^(plugin|plugin)/(.*) index.php?url=$1/$2 [L,QSA]
RewriteRule ^search/(.*) index.php?url=/search/$1 [L,QSA]
RewriteRule ^(serendipity\.css|serendipity_admin\.css) index.php?url=/$1 [L,QSA]
RewriteRule ^index\.(html?|php.+) index.php?url=index.html [L,QSA]
RewriteRule ^htmlarea/(.*) htmlarea/$1 [L,QSA]
RewriteRule (.*\.html?) index.php?url=/$1 [L,QSA]
RedirectMatch gone archives/(.*)
<Files *.tpl.php>
deny from all
</Files>
<Files *.tpl>
deny from all
</Files>
<Files *.sql>
deny from all
</Files>
<Files *.inc.php>
deny from all
</Files>
<Files *.db>
deny from all
</Files>
# END s9y
---------------
I am currently using RedirectMatch gone archives/(.*)
to 410 the articles in /archives/, but that is insufficient because doing so means I lose all my search engine rankings by saying those files no longer exist. Translated that means I'm back down to zero traffic after two years of work.
So, I need a way to redirect the old files to the new urls so that I do not lose my traffic.