Results 1 to 8 of 8

Wordpress 301 Redirect Help Please

This is a discussion on Wordpress 301 Redirect Help Please within the General Discussion forums, part of the vBulletin SEO Discussion category; I need to change my url structure to include an id so I want to just do it the way ...

  1. #1
    Senior Member Array BamaStangGuy's Avatar
    Real Name
    Brent Wilson
    Join Date
    Aug 2005
    Location
    Huntsville, Alabama
    Posts
    2,491
    Liked
    8 times

    Wordpress 301 Redirect Help Please

    I need to change my url structure to include an id so I want to just do it the way I should have done it when I started.

    Right now I am simply using: %postname%

    I want to change it to /topic-%year%%post_id%/

    So the urls would go from /this-is-a-sweet-topic/

    to /topic-2006123/

    How would I 301 redirect the this-is-a-sweet-topic/ to the new url via .htaccess?

  2. #2
    vBSEO Staff Array Oleg Ignatiuk's Avatar
    Real Name
    Oleg Ignatiuk
    Join Date
    Jun 2005
    Location
    Belarus
    Posts
    25,818
    Liked
    192 times
    I guess you will have to create one rewrite rule per post in this case:
    Code:
    RewriteRule ^this-is-a-sweet-topic/ http://www.domain.com/topic-2006123/ [L,R=301]
    Oleg Ignatiuk / Crawlability Inc.
    Security bulletin - Patch Level for all supported versions released

    Unveiling the NEW vBSEO Sitemap Generator 3.0. - available NOW for vBSEO Customers!


  3. #3
    Senior Member Array BamaStangGuy's Avatar
    Real Name
    Brent Wilson
    Join Date
    Aug 2005
    Location
    Huntsville, Alabama
    Posts
    2,491
    Liked
    8 times
    Thanks I just needed the correct rule to give me a start

  4. #4
    Senior Member Array
    Real Name
    Brian
    Join Date
    Apr 2006
    Posts
    6,983
    Liked
    10 times
    didn't i tell you to do this? :P
    Blogger Skills » Blog SEO Part 1

  5. #5
    Senior Member Array BamaStangGuy's Avatar
    Real Name
    Brent Wilson
    Join Date
    Aug 2005
    Location
    Huntsville, Alabama
    Posts
    2,491
    Liked
    8 times
    The following is not working:
    Code:
    RewriteRule ^ford-mustang-video-game/ http://www.mustangevolution.com/topic-5/ [L,R=301]
    RewriteRule ^chip-foose-stallion-mustang/ http://www.mustangevolution.com/topic-6/ [L,R=301]
    RewriteRule ^shelby-gt500-convertible/ http://www.mustangevolution.com/topic-7/ [L,R=301]
    RewriteRule ^shelby-2005-cs6/ http://www.mustangevolution.com/topic-8/ [L,R=301]
    RewriteRule ^2007-shelby-gt500/ http://www.mustangevolution.com/topic-9/ [L,R=301]
    RewriteRule ^stockton-firm-faces-suit-ford-trademark-violation/ http://www.mustangevolution.com/topic-10/ [L,R=301]
    RewriteRule ^shelby-mustang-gt500-prices/ http://www.mustangevolution.com/topic-11/ [L,R=301]
    RewriteRule ^2005-rendered-mustang-t-tops/ http://www.mustangevolution.com/topic-12/ [L,R=301]
    RewriteRule ^ford-bold-moves-gt500/ http://www.mustangevolution.com/topic-13/ [L,R=301]
    RewriteRule ^2008-boss-mustang-return/ http://www.mustangevolution.com/topic-14/ [L,R=301]
    RewriteRule ^retail-shelby-gt-h/ http://www.mustangevolution.com/topic-15/ [L,R=301]
    RewriteRule ^2007-shelby-gt-mustang-information/ http://www.mustangevolution.com/topic-41/ [L,R=301]
    RewriteRule ^the-legend-mustang/ http://www.mustangevolution.com/topic-55/ [L,R=301]
    RewriteRule ^ford-mustangs-myspace/ http://www.mustangevolution.com/topic-59/ [L,R=301]
    RewriteRule ^shelby-gt500-road-america/ http://www.mustangevolution.com/topic-61/ [L,R=301]
    RewriteRule ^roush-427r-mustang/ http://www.mustangevolution.com/topic-64/ [L,R=301]
    RewriteRule ^ford-bold-moves-street-racing-video-game/ http://www.mustangevolution.com/topic-68/ [L,R=301]
    RewriteRule ^commercial-video-shelby-gt500-in-germany/ http://www.mustangevolution.com/topic-70/ [L,R=301]
    RewriteRule ^vmptuning-gets-505-to-the-wheels-with-gt500/ http://www.mustangevolution.com/topic-72/ [L,R=301]
    RewriteRule ^the-next-mustang-a-first-look-at-the-2009-ford-mustang/ http://www.mustangevolution.com/topic-81/ [L,R=301]
    RewriteRule ^mustang-gt-520/ http://www.mustangevolution.com/topic-94/ [L,R=301]
    RewriteRule ^saleen-2009-mustang-facelift/ http://www.mustangevolution.com/topic-99/ [L,R=301]
    RewriteRule ^shelby-gt500-debuts-as-nascar-pace-car/ http://www.mustangevolution.com/topic-105/ [L,R=301]
    RewriteRule ^ford-rolls-out-ford-mustang-for-sema-2006/ http://www.mustangevolution.com/topic-107/ [L,R=301]
    RewriteRule ^boss-302-engine-back/ http://www.mustangevolution.com/topic-114/ [L,R=301]
    RewriteRule ^sct-brings-next-generation-tuning-with-livewire/ http://www.mustangevolution.com/topic-120/ [L,R=301]
    RewriteRule ^2010-mustang-wagon-speculated-by-german-magazine/ http://www.mustangevolution.com/topic-126/ [L,R=301]
    RewriteRule ^giugiaro-2010-mustang-concept-picture/ http://www.mustangevolution.com/topic-129/ [L,R=301]
    RewriteRule ^viva-la-mustang-ford-releases-giugiaro-mustang-information/ http://www.mustangevolution.com/topic-131/ [L,R=301]
    RewriteRule ^shelby-gt-police-chase-commercial/ http://www.mustangevolution.com/topic-140/ [L,R=301]
    RewriteRule ^bullitt-and-boss-mustang-to-return-in-late-2007/ http://www.mustangevolution.com/topic-141/ [L,R=301]
    RewriteRule ^shelby-gt-mustang-production-starts-in-january/ http://www.mustangevolution.com/topic-142/ [L,R=301]
    RewriteRule ^35-duratec-v-6-and-46-3-valve-v-8-engines-top-wards-10-best-engines/ http://www.mustangevolution.com/topic-143/ [L,R=301]
    RewriteRule ^2007-mustang-meets-ipod/ http://www.mustangevolution.com/topic-97/ [L,R=301]
    RewriteRule ^interview-with-doug-gaffka-on-designing-the-shelby-gt500/ http://www.mustangevolution.com/topic-51/ [L,R=301]
    RewriteRule ^ford-mustang-sales-up-64-from-august-2005/ http://www.mustangevolution.com/topic-57/ [L,R=301]
    All it does is take my to the mainpage and the url is to the old permalink

  6. #6
    vBSEO Staff Array Oleg Ignatiuk's Avatar
    Real Name
    Oleg Ignatiuk
    Join Date
    Jun 2005
    Location
    Belarus
    Posts
    25,818
    Liked
    192 times
    Is this full contents of your .htaccess? Didn't you forget to add "RewriteEngine on" to the top?
    Oleg Ignatiuk / Crawlability Inc.
    Security bulletin - Patch Level for all supported versions released

    Unveiling the NEW vBSEO Sitemap Generator 3.0. - available NOW for vBSEO Customers!


  7. #7
    Senior Member Array BamaStangGuy's Avatar
    Real Name
    Brent Wilson
    Join Date
    Aug 2005
    Location
    Huntsville, Alabama
    Posts
    2,491
    Liked
    8 times
    Full content:
    Code:
    <IfModule mod_rewrite.c>
    RewriteEngine On
    RewriteCond &#37;{HTTP_HOST} !^www\.mustangevolution\.com
    RewriteRule ^(.*)$ http://www.mustangevolution.com/$1 [L,R=301]
    # Redirect FeedBurner to your own Feed
    RewriteBase /
    RewriteRule ^feedburner_711296/?$ /feed/ [R,L]
    RewriteCond %{HTTP_USER_AGENT} ^FeedBurner.*$
    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteCond %{REQUEST_FILENAME} !-d
    RewriteRule . /index.php [L]
    # These Rules redirect all feed Traffic to FeedBurner
    RewriteBase /
    RewriteCond %{QUERY_STRING} ^feed=(feed|rdf|rss|rss2|atom)$
    RewriteRule ^(.*)$ http://feeds.feedburner.com/mustangnews [R,L]
    RewriteRule ^(feed|rdf|rss|rss2|atom)/?(feed|rdf|rss|rss2|atom)?/?$ http://feeds.feedburner.com/mustangnews [R,L]
    RewriteRule ^wp-(feed|rdf|rss|rss2|atom).php http://feeds.feedburner.com/mustangnews [R,L]
    # force trailing slash
    RewriteCond %{REQUEST_URI} /+[^\.]+$
    RewriteRule ^(.+[^/])$ /$1/ [R=301,L]
    # These are the standard WordPress Rules
    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteCond %{REQUEST_FILENAME} !-d
    RewriteRule . /index.php [L]
    </IfModule>
    # BEGIN WordPress
    <IfModule mod_rewrite.c>
    RewriteEngine On
    # Redirect FeedBurner to your own Feed
    RewriteBase /
    RewriteRule ^feedburner_711296/?$ /feed/ [R,L]
    RewriteCond %{HTTP_USER_AGENT} ^FeedBurner.*$
    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteCond %{REQUEST_FILENAME} !-d
    RewriteRule . /index.php [L]
    # These Rules redirect all feed Traffic to FeedBurner
    RewriteBase /
    RewriteCond %{QUERY_STRING} ^feed=(feed|rdf|rss|rss2|atom)$
    RewriteRule ^(.*)$ http://feeds.feedburner.com/mustangnews [R,L]
    RewriteRule ^(feed|rdf|rss|rss2|atom)/?(feed|rdf|rss|rss2|atom)?/?$ http://feeds.feedburner.com/mustangnews [R,L]
    RewriteRule ^wp-(feed|rdf|rss|rss2|atom).php http://feeds.feedburner.com/mustangnews [R,L]
    # These are the standard WordPress Rules
    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteCond %{REQUEST_FILENAME} !-d
    RewriteRule . /index.php [L]
    </IfModule>
    
    # END WordPress
    Where should I place the new rules? Also this .htaccess looks bloated. Are there duplicates in there that should be?

  8. #8
    vBSEO Staff Array Oleg Ignatiuk's Avatar
    Real Name
    Oleg Ignatiuk
    Join Date
    Jun 2005
    Location
    Belarus
    Posts
    25,818
    Liked
    192 times
    They should go right after "RewriteEngine On" line.

    I guess that 2nd <IfModule mod_rewrite.c>...</IfModule> block is redundant
    Oleg Ignatiuk / Crawlability Inc.
    Security bulletin - Patch Level for all supported versions released

    Unveiling the NEW vBSEO Sitemap Generator 3.0. - available NOW for vBSEO Customers!


Similar Threads

  1. Different 301 Redirect formats
    By oddmusic in forum General Discussion
    Replies: 12
    Last Post: 03-16-2008, 11:47 AM
  2. 301 fügt ?vbseourl= mit an
    By Junior in forum Deutsch
    Replies: 8
    Last Post: 11-20-2006, 01:07 PM
  3. 301 Redirect Original Content (posts)
    By thecat in forum Troubleshooting
    Replies: 2
    Last Post: 10-04-2006, 10:00 AM
  4. Stuck setting up a 301 redirect
    By Pixalo in forum URL Rewrite Settings
    Replies: 3
    Last Post: 06-06-2006, 05:36 PM
  5. 301 redirect not working?
    By googledave in forum Troubleshooting
    Replies: 2
    Last Post: 02-12-2006, 08:37 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
  •