Server Fault is a question and answer site for system and network administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I got a forum installed, which is accessed on I need to make some other pages accessed on, and forum on I dont think moving forum to another folder is a good idea, so i decided to use mod_rewrite. Here is my .htaccess file:

<IfModule mod_rewrite.c>
    RewriteEngine on
    RewriteCond %{HTTP_HOST} ^www\.(.*)$ [NC]
    RewriteRule ^ http://%1%{REQUEST_URI} [L,R=301]
    RewriteRule ^forum$ /index.php$1 [S=3]
    RewriteRule ^forum/$ /index.php$1 [S=2]
    RewriteRule ^forum/(.*)$ /$1 [S=1]   
    RewriteRule    ^$ homepage/  [L]

First 2 lines are used to redirect from to Next 3 rules are used to redirect all requests, and the last rule redirects all requests to homepage folder.

Here is a problem with current .htaccess: it shows /homepage/index.php if i open, but it doesnt if i open instead it shows /index.php.

any ideas how to fix this?

share|improve this question
up vote 0 down vote accepted

The issue you are facing is with that last rewrite rule. What it is saying is:

if I get a request for, send it to homepage/ does not match this.

So, you have a few choices. You can maintain this list by hand (pain in the arse), or you can use some wildcards.

Try adding a rule like this:

RewriteRule    ^*.*$ homepage/  [L]


Upon further examination of this problem, I think there is a better solution. In your (probably ) directive, modify the directories as so

    DocumentRoot /path/to/public_html

    <Directory />
            Options FollowSymLinks
            AllowOverride None
    <Directory "/path/to/forums/">
            Options Indexes FollowSymLinks MultiViews
            AllowOverride None
            Order allow,deny
            allow from all

    #This moves your forums to a new folder
    Alias /path/to/forums
    <Directory "/path/to/public_html/">
            Options Indexes FollowSymLinks MultiViews
            AllowOverride None
            Order allow,deny
            allow from all

Or, of course, you can modify this to use the forums subdomain, so instead of , users will go to

share|improve this answer
I tried the rule you posted, but i get Internal Server Error with it :( I also tried RewriteRule ^index.php$ homepage/index.php [L], it doesnt work too. – nls Sep 8 '10 at 11:55

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.