WordPress.org

Ready to get started?Download WordPress

Forums

WordPress rewrite issue (2 posts)

  1. penguinws
    Member
    Posted 10 months ago #

    I'm trying to get:

    domain.com/video*

    forwarded to

    domain.com/blog/video*

    I tried adding this line to the bottom of my .htaccess with no luck:

    RewriteRule ^video(.*) blog/video

    I also tried adding this to my functions.php:

    add_action( 'init', 'rewrites_init' );
    function rewrites_init(){
        add_rewrite_rule(
            'video(.*)',
            'blog/video',
            'top' );
    }

    But I still get a 404 error. Thanks.

  2. Pioneer Valley Web Design
    Member
    Posted 10 months ago #

    In root folder of domain .htaccess file at very top:

    <IfModule mod_rewrite.c>
    RewriteEngine On
    RewriteRule ^/video/(.*)$ http://www.yoursite.com/blog/video/$1 [L,R=301]
    </IfModule>

    you can leave the www. out...

Reply

You must log in to post.

About this Topic