Wordpress paths Problem..

by 5 replies
6
Hi

If we change from a post format of something like

www.domain.com/catagory/date/postname

To

www.domain.com/postname

Is there anyway to make it so the old links redirect to where the new URL ?
#programming #paths #problem #wordpress
  • Hi Simon

    I think that the best way would be to modify your .htaccess file with a line like this:

    Code:
    Redirect 301 /catagory/date/postname http:/ www.domain.com/postname
    If you don't have access to .htaccess you could put a static PHP page at www.domain.com/catagory/date/postname/index.php and use a redirect to send traffic to the new page:

    Code:
    <?php
    header( 'Location: www.domain.com/postname' ) ;
    ?>
    One of these should do the trick!

    Best of luck, please let me know if you need any assistance

    Bill
    • [ 1 ] Thanks
  • Simon, hi,

    WordPress attempts to do the .htaccess update when you change permalinks - if it can't access your .htaccess file for any reason it will give you the code with an instruction to paste it into the file.

    After saving your updates be sure to check for a message that WP will give you if it has problems.

    I also use the Redirection plugin, but that's belt and braces really.

    Cheers,

    Martin.
    • [ 1 ] Thanks
  • Thanking you both, I'll pass this on to my coder.
  • Simon there is also a plugin that will redirect Permalink Redirect WordPress Plugin | SYP
  • use can use 301 redirect rule in .htaccess file only in linux hosting

Next Topics on Trending Feed