Forums

Look at this config file. Whats wrong? (10 posts)

  1. wordpresser32
    Member
    Posted 5 years ago #

    First if all: yes, I have read a lot of other supposrt posts already about this.

    I have set up permalinks successfully before on a hosted server from a popular provider. Meaning I know the process and how to setup the .htaccess and all that for wordpress to use the pretty links.

    Now I'm trying to setup permalinks in a wordpress instalation on my own server at my company. The Apache is setup and the mod_rewrite function is installed.
    The htaccess was created by wordpress and i added the "Options +Followsymlinks" line as suggested in another post on this board (I also tried it without the followsymlinks line).

    So it looks like this now:

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

    # END WordPress

    Also, the Apache server is configured like this:

    <Directory/>
    Options Name
    AllowOverride All
    Order deny, allow
    Deny from all
    </Directory>

    Still, this time around Im not so lucky. It just doesn't work. What could be the problem in the config files or what other cause could there be that the pretty links not work for me?

    Thanks in advance... Hope somebody can give me some advice.

  2. manstraw
    Member
    Posted 5 years ago #

    What won't work exactly? Can you describe more what happens? What uri does a link show? What do you see after you click on it?

  3. wordpresser32
    Member
    Posted 5 years ago #

    When I hover over a link then the pretty link is shown but when I click it it will go to a error page.

    On the system i installed wordpress before with permalinks successfully, it was the same after i changed to permalinks. When hovering over the links in wordpress the pretty I can see that the pretty links show but when clicked they just go to a error page. I hadn't set the .htaccess that time which was the problem. But this time the .htaccess is set correctly and everything so I dont know what is thep roblem.

  4. manstraw
    Member
    Posted 5 years ago #

    can you provide a link to the problem site? so we can check it out.

  5. Otto
    Tech Ninja
    Posted 5 years ago #

    <Directory/>
    Options Name
    AllowOverride All
    Order deny, allow
    Deny from all
    </Directory>

    That don't look right. Deny from all? So... nobody is allowed to connect to the site? Seems like a possible problem, ya think? Unless you have another Directory directive overriding that one in the httpd.conf file, of course.

  6. wordpresser32
    Member
    Posted 5 years ago #

    OK. Thanks for the effort manstraw. The site can be found here:

    http://www.excelloz.com/blog

    Right now though, I have the "almost pretty links" function set where a "index.php" is set into the URL. As this is a company blog I cannot really have it not work too long, that's why right now there I set it back to this as it's working.

  7. wordpresser32
    Member
    Posted 5 years ago #


  8. manstraw
    Member
    Posted 5 years ago #

    What is your permalinks line in wordpress with the index.php version, and what is the .htaccess file reading?

  9. wordpresser32
    Member
    Posted 5 years ago #

    My htaccess file reads:

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

    # END WordPress

    the custom link structure (is that what you meant?) i use right now is:
    /index.php/%year%/%monthnum%/%day%/%postname%/

  10. Otto
    Tech Ninja
    Posted 5 years ago #

    That .htaccess file is correct, but it might help you figure out what's wrong if you understand what it's doing.

    Basically, it silently redirects any traffic for files/directories that don't really exist to the index.php file in WordPress' root directory. The -f and -d bits basically say to redirect when the file or directory being referenced don't exist. This lets links to images and such work, while redirecting permalinks to index.php.

    So virtually everything happens through index.php. This is why your blog works when you add the index.php to the custom link structure, you're doing the same thing the htaccess does, only you're doing it explicitly.

    WordPress' index.php is pretty basic, just loading up WP itself. WP then examines the link it receives and compares that to the permalink structure, and acts accordingly.

    The upshot here is that if you find that you must add index.php to the custom link structure to make the blog work, then the .htaccess is not working. This is not a blog config problem, it's a webserver config problem. Your webserver is not reading the .htaccess file or it's not setup to allow the .htaccess file to work.

    Could be lots of reasons for this. mod_rewrite might not be enabled, the httpd.conf might not be set to allow .htaccess overrides, whatever. Point is that you need to look at the apache config and figure out what's wrong there.

Topic Closed

This topic has been closed to new replies.

About this Topic