WordPress.org

Ready to get started?Download WordPress

Forums

htaccess permanent re-direct from former static pages giving problem ! (5 posts)

  1. Percept
    Member
    Posted 8 years ago #

    Hi,

    I've redesigned a (formerly static) website and put WordPress behind it. Now I want to redirect the former static category pages to the new wordpress categories but it's not exactly doing what I want and I can't seem to fix it myself:

    here's an example:

    the old url was:
    http://www.domain.com/mag/category.php

    the new url is:
    http://www.domain.com/news/category/

    my htaccess redirect rule is:
    Redirect permanent /mag/category.php http://www.domain.com/news/category/

    and this is where it redirects to:
    http://www.domain.com/news/category/?category_name=mag&name=category.php&page=

    So the redirection url is fine EXCEPT that it's still adding variables at the end.

    Can anyone tell me how I can fix this redirect so t redirects to http://www.domain.com/news/category/ without the variables.

    Thanks in advance !

  2. niziol
    Member
    Posted 8 years ago #

    The following rule always works perfectly for me:

    RedirectMatch permanent ^/news/category.php$ /news/category/

    Cheers,
    Michael.

  3. Percept
    Member
    Posted 8 years ago #

    niziol, thanks for the reply but that has the exact same result as my redirect rules, so people still end up at http://www.domain.com/news/category/?category_name=mag&name=category.php&page=

    which returns a 404

  4. Percept
    Member
    Posted 8 years ago #

    ps: notice that I'm redirecting an old directory 'mag' to 'news' it's not just the extension that's changes.

  5. Percept
    Member
    Posted 8 years ago #

    Anyony an idea maybe ? I really want to fix this ...

Topic Closed

This topic has been closed to new replies.

About this Topic