SitePoint Sponsor

User Tag List

Results 1 to 3 of 3
  1. #1
    SitePoint Member
    Join Date
    Jul 2001
    Posts
    17
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    301 redirect help

    I am switching CMS platforms and trying to create 301 redirects in htaccess.

    This is what I have written but it will not redirect it just displays 404 error page.

    RewriteRule ^/category/merchants/123inkjets/?$ stores/123inkjets/ [R=301,NC,L]

    What am I doing wrong?

    Thanks

  2. #2
    Utopia, Inc. silver trophy
    ScallioXTX's Avatar
    Join Date
    Aug 2008
    Location
    The Netherlands
    Posts
    9,070
    Mentioned
    153 Post(s)
    Tagged
    2 Thread(s)
    Assuming this is Apache 2 (since 1 is almost not used anymore),you need to drop the leading slash:

    Code:
    RewriteRule ^category/merchants/123inkjets/?$ stores/123inkjets/ [R=301,NC,L]
    I assume you have RewriteEngine On in your .htaccess too somewhere above that RewriteRule?

    Also, since this is pretty simple redirect, I'd use mod_alias instead of mod_rewrite. Simply

    Code:
    Redirect 301 /category/merchants/123inkjets http://yourdomain.com/stores/123inkjets/
    Rémon - Hosting Advisor

    SitePoint forums will switch to Discourse soon! Make sure you're ready for it!

    Minimal Bookmarks Tree
    My Google Chrome extension: browsing bookmarks made easy

  3. #3
    SitePoint Member
    Join Date
    Jul 2001
    Posts
    17
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Awesome. Thanks! Works perfectly.


Bookmarks

Posting Permissions

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