WordPress.org

Ready to get started?Download WordPress

Forums

Redirect In Htaccess (2 posts)

  1. slaterino
    Member
    Posted 1 year ago #

    Hi,
    I am trying to do what I thought would be a basic redirect in htaccess but am having a lot of problems. Basically, I've changed my structure so that now for a category the permalink is http://www.soundsandcolours.com/travel instead of http://www.soundsandcolours.com/content/subjects/travel/ so I am trying to create a Rewrite Rule to do the redirect. Is there any way to create a simple rule that will do this redirect for all of my categories? My attempt at trying to do the redirect for just the Travel directory is below but this wasn't working. Any ideas why?

    <IfModule mod_rewrite.c>
    RewriteEngine On
    RewriteBase /
    RewriteRule ^index\.php$ - [L]
    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteCond %{REQUEST_FILENAME} !-d
    RewriteRule . /index.php [L]
    RewriteRule ^content/subjects/travel(/.*)?$ /travel$1 [L,R=301][L,R=301]
    </IfModule>

    Thanks!
    Russ

  2. Greg
    Member
    Posted 1 year ago #

    Looks like you got it figured out? I checked your site and all the categories seem to working like you wanted.

Topic Closed

This topic has been closed to new replies.

About this Topic