Trying to redirect this format
archive/topic/t-59411_Nastase_RHIC_produces_black_holes.html
to this:
archive/index.php/t-59411.html
I can only find examples of what to do if they were querystrings.
thanks!!
| SitePoint Sponsor |
Trying to redirect this format
archive/topic/t-59411_Nastase_RHIC_produces_black_holes.html
to this:
archive/index.php/t-59411.html
I can only find examples of what to do if they were querystrings.
thanks!!
Free Science Homework Help
http://www.physicsforums.com
fyi, I am looking for a redirect. the first url does not exist, it only exists in the second format
Free Science Homework Help
http://www.physicsforums.com

replace example.com with your domainCode:Redirect permanent /archive/topic/t-59411_Nastase_RHIC_produces_black_holes.html http://example.com/archive/index.php/t-59411.html
(see http://httpd.apache.org/docs/current....html#redirect)
Rémon - Hosting Advisor
Minimal Bookmarks Tree
My Google Chrome extension: browsing bookmarks made easy
Free Science Homework Help
http://www.physicsforums.com

Rémon - Hosting Advisor
Minimal Bookmarks Tree
My Google Chrome extension: browsing bookmarks made easy
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?
Free Science Homework Help
http://www.physicsforums.com

Rémon - Hosting Advisor
Minimal Bookmarks Tree
My Google Chrome extension: browsing bookmarks made easy
I'll give it a go for funsies.
RewriteRule ^archive/(?:topic/)?(?:t-)?(\d+)[^/]*\.html$ /archive/index.php/t-$1.html [R=301,L]
"Folks who know what they're doing make complexity seem simple."

That misses two of the rules
because they don't end in .html, so that should be an optional group as well.Code: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]
Off Topic:
I never knew Apache 2 supported non-matching groups, good to know!![]()
Rémon - Hosting Advisor
Minimal Bookmarks Tree
My Google Chrome extension: browsing bookmarks made easy
Oops. You're right.
If the extension is optional, then we may be able to get away with leaving off the end of the pattern altogether.
RewriteRule ^archive/(?:topic/)?(?:t-)?(\d+) /archive/index.php/t-$1.html [R=301,L]
"Folks who know what they're doing make complexity seem simple."
Bookmarks