• Resolved twistedtwig

    (@twistedtwig)


    Hi all,

    Firstly I would like to say thank you for WP for what seems to be a great product. Also I have tried searching the forums for an answer but either do not know enough, did not understand an answer if I found one, or just couldn’t find an answer to my question.

    I am very new to WP and in general am really enjoying it. I have installed WP to my system which is running well:

    http://csjblog.houseofhawkins.com/

    my setup is:

    Ubuntu 7.10 server with lamp.
    DDNS with easydns.com

    I know mod rewrite works as I already use it to rewrite some URL’s when I use proxypassreverse to forward part of my site to a windows box.

    I am using a subdomain for this blog. with easydns doing my dns for me it all points at houseofhawkins.com and I use vhost to decide where it should actually go.

    My problem is that if I try anything apart from default:

    http://csjblog.houseofhawkins.com/?p=123

    for example:

    Day and name
    http://csjblog.houseofhawkins.com/2008/05/26/sample-post/

    I get 404 Not found error:

    Not Found

    The requested URL /2008/05/25/blog-site-released/ was not found on this server.

    I am not sure if it is trying to redirect to my main site, i.e. coming out of the subdomain and that is why it can not find it, but I am rather confused and would be very grateful for some guidance.

    Thank you

Viewing 11 replies - 1 through 11 (of 11 total)
  • Thread Starter twistedtwig

    (@twistedtwig)

    I just saw another post about permalinks that was saying their .htaccess file was not being updated. So I thought I would check if mine was.

    When I first looked at it it was blank (apart from two comments, begin and end). I changed the links to:

    /%year%/%monthnum%/%day%/%postname%/

    and I get the 404

    Not Found

    The requested URL /2008/05/25/blog-site-released/ was not found on this server.
    Apache/2.2.4 (Ubuntu) PHP/5.2.3-1ubuntu6.3 mod_perl/2.0.2 Perl/v5.8.8 Server at csjblog.houseofhawkins.com Port 80

    When I look at the .htaccess file now it has more in it:

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

    So I am confused again now 🙁

    Go to your dashboard and select options, permalinks. Scroll to the bottom of the page and see if this message is displayed:

    “If your .htaccess file were writable, we could do this automatically, but it isn’t so these are the mod_rewrite rules you should have in your .htaccess file. Click in the field and press CTRL + a to select all.”

    If so, temporarily chmod your .htaccess file to 777. Go to your dashboard and set your permalinks to the desired structure and update. Note the resulting messages, if any. .htaccess needs to be writable by WordPress in order for WordPress to make the changes. Make sure that you chmod .htaccess back to 644 when done. Do not leave it “World Writable”. If this is not successful, at least it may help in guiding you to the real problem.

    I know this may sound like redundant information, but sometimes just “refreshing” the permalink structure seems to be a cure.

    Thread Starter twistedtwig

    (@twistedtwig)

    Hi Clayton,

    Thanks for the reply. If I 644 the file I do get that error. If it is 777 it says it is saved. Even if it is 777 and I try and view the site (used CTRL + F5) I still get the server error.

    You can also try to delete the htaccess file, edit permalink structure, upload a blank text file that you will rename .htaccess, chmod it to 666 and see what happens when you once again change permalink structure ?

    Some hosts don’t support mod_rewrite, but this is incredibly rare. You may ask your support team ?

    Just in case, here is the basic essential structure of a wordpress htaccess file, I prefer to copy and paste rather than waste minutes comparing your version to mine 😉

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

    my setup is:

    Ubuntu 7.10 server with lamp.
    DDNS with easydns.com

    I know mod rewrite works as I already use it to rewrite some URL’s when I use proxypassreverse to forward part of my site to a windows box.

    I am using a subdomain for this blog. with easydns doing my dns for me it all points at houseofhawkins.com and I use vhost to decide where it should actually go.

    I’m going out on a limb here and assuming that this server is within your physical control. It has been quite a while since I used Ubuntu, so if I sound way off base, you have my sincere apologies in advance. Just for the sake of knowing, (and you have already stated that you know mod_rewrite is working, so you have loaded it from mods-available to mods-enabled), take a look here;

    /etc/apache2/sites-enabled/000-default

    (boy, I hope that is the right path in ubuntu), and If memory serves me correctly, you may have to change the AllowOverride None directive to AllowOverride All, in order for mod_rewrite to work on virtual hosts.

    Normally I would refer you to the httpd.conf file, but I think the structure is a little different in Ubuntu, and I don’t want to send you on a wild goose-chase, so I’m hoping someone will step in and verify if what I am saying makes any sense at all.

    Of course this probably only applies if your server is available at your location, or you are on a dedicated VM with your host.

    p.s. if you change it, don’t forget to restart Apache for the changes to take effect.

    Thread Starter twistedtwig

    (@twistedtwig)

    Clayton, your brilliant!!!

    AllowOverride All = The answer!!!

    Thank you for all your help guys.

    You are very welcome, and “slightly tarnished”, is probably a more accurate description! I just got lucky.

    🙂

    Thank you Clayton 🙂

    I have spent days reading posts and trying different things, I don’t understand how to find mod_rewrite, I have only got up to changing .htaccess with success.

    The server im using is apache and I’ve spoke to hosting ppl who say I have full access?

    My problem was after changing .htaccess and trying to make a “pretty” permalink, once the changes were made I received the 404 error not found.

    I fixed this by inserting index.php at the beginning of the permalink structure:

    /index.php/%postname%/

    This is not as clean and “pretty” as I would like, but it sure is better than the default.

    Hope this helps – It is in the main permalink post, although I scanned past it numerous times.

    Is there any suggestions how I could get rid of the index.php in the structure and still make it work?!?

    Hey just encase someone searches for this and finds it. I had to do

    sudo a2enmod rewrite
    sudo /etc/init.d/apache2 restart

    in ubuntu to get mod_rewrite to work.

    So there it is for those who know there .htaccess is correct and know there apache2.conf / httpd.conf is correct.

    Thanks so much everyone, it works!

    Love you all.

Viewing 11 replies - 1 through 11 (of 11 total)
  • The topic ‘Permalink does not work apart from default.’ is closed to new replies.