The MU forums have moved to

Interesting .htaccess (ModRewrite) challenge. (2 posts)

  1. taylhis
    Posted 12 years ago #

    Here is my current .htaccess file:

    RewriteEngine On
    RewriteBase /
    #uploaded files
    RewriteRule ^(.*/)?files/$ index.php [L]
    RewriteRule ^(.*/)?files/(.*) wp-content/blogs.php?file=$2 [L]
    RewriteCond %{REQUEST_FILENAME} -f [OR]
    RewriteCond %{REQUEST_FILENAME} -d
    RewriteRule . - [L]
    RewriteRule  ^([_0-9a-zA-Z-]+/)?(wp-.*) $2 [L]
    RewriteRule  ^([_0-9a-zA-Z-]+/)?(.*\.php)$ $2 [L]
    RewriteRule . index.php [L]

    Everything works fine -- all subdirs, etc...

    The problem is I have installed regular wordpress in a subdir

    I want the htaccess file to redirect requests to JUST the homepage ( or to the subdirectory. But only direct to the homepage.

    So, (or would redirect to but would still work for the blogs which are setup to use subdomains. Also, for example, would NOT redirect to but would stay in the correct subdir.

    A bit confused?

    simply -- I want only visits to my HOMEPAGE with WWW or NO SUBDOMAIN redirected to a sub directory.

  2. dgilmour
    Posted 12 years ago #

    In the .htaccess file in the root directory of, insert a Redirect rule to redirect index.html to, like this:

    Redirect /index.html

    You'll need to make sure that any existing index.html is renamed out of the way, of course.

About this Topic

  • Started 12 years ago by taylhis
  • Latest reply from dgilmour