• Hi there,

    I have recently installed wordpress on my website and the install went fine.

    after install, I realised that it did not go straight to the index.php file but to the root of the directory.

    so my friend tells me to add this .htaccess file with DirectoryIndex index.php line in it. This works fine.

    Until…

    I add content to my about page. No my site reverts to going back to the root of the directory.

    Simple I think, i’ll just replace the .htaccess file again and it should work.

    NO! once I restored the file it worked for going to the main page, but if I click on my about link then my server says file not found. If I unpublish and publish my about page, boom, it works again, but then the website goes back to the root directory!?!?

    can anyone help a stupid person please?

Viewing 4 replies - 1 through 4 (of 4 total)
  • Moderator Jan Dembowski

    (@jdembowski)

    Forum Moderator and Brute Squad

    The easy answer is that PHP is not setup correctly on your server.

    In you apache.conf file you should have a line like

    DirectoryIndex index.html index.php

    If you only see index.html then just add index.php to that line and restart apache.

    (Before you make any changes to your apache.conf files BACKUP the file first…)

    Thread Starter geejayoh

    (@geejayoh)

    well.

    my site is hosted on his server. but he has other domains on there.

    I pointed the my domain geejayoh.com towards his name servers and he set up http://www.geejayoh.com to point to a webspace on his.

    I noticed that after updating a page on the wordpress site, it rewrites the .htaccess file with this line:

    # BEGIN WordPress
    <IfModule mod_rewrite.c>
    RewriteEngine On
    RewriteBase /
    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteCond %{REQUEST_FILENAME} !-d
    RewriteRule ./index.php [L]
    </IfModule>
    
    # END WordPress

    if I do what you said, will it work?

    Well, it sounds like your friend needs to make sure that the apache.conf file is configured correctly. That should be in there to begin with. Did your friend set you up with a web hosting account/cpanel access? Or do you have to go through him to manange your site? In any event, yes, it should work just fine, and WP will need to write to the .htaccess file when you turn permalinks on/off.

    Moderator Jan Dembowski

    (@jdembowski)

    Forum Moderator and Brute Squad

    Yep, I just tried it. As long as your friend permits .htaccess (AllowOverride All turned on for your directory) then create your own .htaccess in your WordPress directory and put in it:

    DirectoryIndex index.php

    If you turn on permalinks then WordPress will just append that file.

    If he does not fix his Apache conf then odds are good that he won’t allow overrides either. If this does not work, you might want to try a new web host.

Viewing 4 replies - 1 through 4 (of 4 total)

The topic ‘[.htaccess question] newb with this’ is closed to new replies.