WordPress.org

Ready to get started?Download WordPress

Forums

Two URLs for same blog site? (1 post)

  1. dbvista
    Member
    Posted 3 years ago #

    I'm trying to do a simple Apache RewriteRule in a multisite installation and for some reason, it's having no effect at all. For example, I'd like http://example.com/yourblog/.* to redirect to http://example.com/myblog/.*. So I added this to .htaccess:

    RewriteRule ^yourblog/(.*) myblog/$1

    The rule has no effect at all when I hit http://example.com/yourblog/. I get a 404 error rendered in a WordPress page, as if the rule weren't there. So something (a 404 handler?) is overriding my URL before the RewriteRule can take effect.

    Even a silly rule like this one has no effect:

    RewriteRule ^yahoo http://www.yahoo.com [R]

    What's the right way to give a blog site multiple URLs?

    The current .htaccess file is pretty standard.

    RewriteEngine On
    RewriteBase /
    RewriteRule ^index\.php$ - [L]
    
    # uploaded files
    RewriteRule ^([_0-9a-zA-Z-]+/)?files/(.+) wp-includes/ms-files.php?file=$2 [L]
    
    # add a trailing slash to /wp-admin
    RewriteRule ^([_0-9a-zA-Z-]+/)?wp-admin$ $1wp-admin/ [R=301,L]
    
    RewriteCond %{REQUEST_FILENAME} -f [OR]
    RewriteCond %{REQUEST_FILENAME} -d
    RewriteRule ^ - [L]
    RewriteRule  ^([_0-9a-zA-Z-]+/)?(wp-(content|admin|includes).*) $2 [L]
    RewriteRule  ^([_0-9a-zA-Z-]+/)?(.*\.php)$ $2 [L]
    RewriteRule . index.php [L]

    Thanks for any help.

Topic Closed

This topic has been closed to new replies.

About this Topic

Tags

No tags yet.