rcymozart Posted August 7, 2005 Posted August 7, 2005 This may go elsewhere, but I couldn't tell which would fit best, so since it was blog-related, here it goes. I just redesigned my site's structure so that my blog is in http://www.domain.com/blog'>http://www.domain.com/blog instead of http://www.domain.com. The problem is that now all of my archive links that people have linked to are broken (since there is a "/blog" inserted between the domain and archive folders). I know regex can probably handle this kind of thing and there is probably something I can do in my .htaccess file to make an automatic rewrite of the requested URL happen. I just don't know enough about regex to figure it out. I've tried learning on my own, but it's gone over my head. Can anyone help me insert the "/blog" into any http request for a URL that starts with http://www.domain.com/archives/x/y/z/ so that it ends up being http://www.domain.com/blog/archives/x/y/z/? Note that the URL string after archives/ will change with each entry, but is predictable up to archives/, that makes any sense. Thanks, Robert Quote
TweezerMan Posted August 7, 2005 Posted August 7, 2005 I believe adding the following to the .htaccess file in your public_html directory will do what you want: >RewriteEngine on RewriteBase / RewriteRule ^archives(.*) /blog/archives$1 Quote
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.