Results 1 to 5 of 5

.htaccess question

This is a discussion on .htaccess question within the Off-Topic & Chit Chat forums, part of the Focus on Members category; This is not vBSEO related, but had a question regarding .htaccess files. I'm moving my main blog from mysite.com/blog/article-title/year/month/day to ...

  1. #1
    Senior Member
    Real Name
    serphog
    Join Date
    Oct 2005
    Posts
    166
    Liked
    0 times
    Blog Entries
    1

    .htaccess question

    This is not vBSEO related, but had a question regarding .htaccess files.

    I'm moving my main blog from mysite.com/blog/article-title/year/month/day to mysite.com/article-title/year/month/day

    Is there a way to do a catch-all .htaccess so that all my URLs are redirected to the new URLs?

  2. #2
    Senior Member
    Real Name
    Ceri May
    Join Date
    Jul 2009
    Location
    United Kingdom
    Posts
    1,726
    Liked
    15 times
    Blog Entries
    1
    Hi,

    This should work.

    RewriteRule ^blog/(.*) http://mysite.com/1$ [L,R=301]
    You will clearly need to change the mysite.com bit for your own domain and this needs to be placed just below the RewriteEngine On

  3. #3
    Senior Member
    Real Name
    serphog
    Join Date
    Oct 2005
    Posts
    166
    Liked
    0 times
    Blog Entries
    1
    Quote Originally Posted by Ceri May View Post
    Hi,

    This should work.



    You will clearly need to change the mysite.com bit for your own domain and this needs to be placed just below the RewriteEngine On
    Great. Thanks! I'll give it a try.

  4. #4
    Senior Member
    Real Name
    serphog
    Join Date
    Oct 2005
    Posts
    166
    Liked
    0 times
    Blog Entries
    1
    No luck. I just moved my site and not having luck with that rewrite. Here are the contents of my .htaccess.

    Code:
    # BEGIN WordPress
    <IfModule mod_rewrite.c>
    RewriteEngine On
    RewriteBase /
    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteCond %{REQUEST_FILENAME} !-d
    RewriteRule . /index.php [L]
    </IfModule>
    
    # END WordPress
    RewriteEngine On
    RewriteRule ^blog/(.*) http://mysite.com/1$ [L,R=301]
    It just 404's. (BTW, my domain is in the actual .htaccess file rewrite).

    Any suggestions?

    Thanks for your help.

  5. #5
    Senior Member
    Real Name
    Ceri May
    Join Date
    Jul 2009
    Location
    United Kingdom
    Posts
    1,726
    Liked
    15 times
    Blog Entries
    1
    The above should be changed to

    # BEGIN WordPress
    <IfModule mod_rewrite.c>
    RewriteEngine On
    RewriteBase /

    RewriteRule ^blog/(.*) http://mysite.com/1$ [L,R=301]

    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteCond %{REQUEST_FILENAME} !-d
    RewriteRule . /index.php [L]
    </IfModule>

    # END WordPress

Similar Threads

  1. htaccess question
    By jswanson in forum General Discussion
    Replies: 2
    Last Post: 05-11-2010, 01:18 AM
  2. .htaccess Question RE: www and no www
    By VinylJunky in forum General Discussion
    Replies: 13
    Last Post: 11-23-2007, 12:14 PM
  3. htaccess question
    By sfnet in forum Troubleshooting
    Replies: 5
    Last Post: 10-19-2007, 07:07 PM
  4. .htaccess question
    By myfishtanknet in forum General Discussion
    Replies: 3
    Last Post: 09-11-2007, 09:29 PM
  5. .htaccess question
    By Aneurysm in forum General Discussion
    Replies: 1
    Last Post: 12-05-2006, 02:55 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •