Trying to redirect this format archive/topic/t-59411_Nastase_RHIC_produces_black_holes.html to this: archive/index.php/t-59411.html thanks!!
RewriteRule ^archive/topic/t-59411_Nastase_RHIC_produces_black_holes.html$ archive/index.php/t-59411.html [L] This assumes your have mod_rewrite turned on and an .htacess file in your home or root directory. This will only rewrite an exact match on the URL.
also I want to make sure this is a redirect. the first url does not exist. the content only exists on in the second url.
Your first question is a bit more involved and would require a different set of rules and regexes . The second part...the redirect. What I gave you will redirect any request...whether it actually exists or not to the redirect URL. Itwould be consider at 301 redirect. You could make it a 302...but I think that is not what is needed.
I got what I wanted mostly from this: RewriteRule ^archive/topic/t-([0-9-]+)([[a-zA-Z0-9_]*).html$ archive/index.php/t-$1.html [R=301,L] RewriteRule ^archive/topic/t-([0-9-]+)$ archive/index.php/t-$1.html [R=301,L] RewriteRule ^archive/topic/([0-9-]+).html$ archive/index.php/t-$1.html [R=301,L] RewriteRule ^archive/t-([0-9-]+)([[a-zA-Z0-9_]+).html$ archive/index.php/t-$1.html [R=301,L] RewriteRule ^archive/t-([0-9]+)$ archive/index.php/t-$1.html [R=301,L] I assume it's not very efficent. Is there a more compact way to do this?