• Yes, I know. There’s oodles of info out there on this issue. I’ve been trying every solution from every thread I’ve found (and the solutions in the codex) and none seems to be working. I’m pretty sure AllowOverride is “on” on the client’s server, as pretty much everything I put in the .htaccess file is working (except for this permalink thing).

    Honestly, I think it’s the way I have WordPress set up. I did the thing where you upload WordPress into it’s own folder, but you put in a new index page in the root with the “require wp_head” stuff in it, and change the path in Admin. This is all working fine and dandy.

    I should note I also had to put in an override in .htaccess to make the server look at “index.php” to be served up as the index page, rather than showing a list of files when no index.html file is present (which is what it *was* doing).

    I am also trying to serve up a static front page – basically because the index page has a slightly different template than the inside pages.

    I have tried everything I can find (as I’ve said) to make the pretty permalinks happen. It looks as though the .htaccess *is* doing what it’s supposed to do: when you mouse over the nav links, you can see the URL *has* changed to the “pretty” structure, but when you click on it, the “Not Found” error comes up. I looked at the server logs, and this is the error that shows (for many variations on attempts at making this work):

    [Thu Sep 7 19:35:02 2006] [error] [client xx.xx.xx.xx] File does not exist: /usr/local/etc/httpd/vhosts/DOMAINNAMEHERE.org/htdocs/archives/category/about/

    That’s the initial error I get when the initial permalink setup is chosen (name & number is what I want).

    Then I tried to put in the <directory> trick shown in this post, and *every time* I end up with an internal server error. The error log reads as such:

    [Fri Sep 8 08:30:15 2006] [alert] [client xx.xx.xx.xx] /usr/local/etc/httpd/vhosts/DOMAINNAMEHERE.org/htdocs/.htaccess: Invalid command ‘<Directory>’, perhaps mis-spelled or defined by a module not included in the server configuration

    When I tried to place it in the WordPress folder (one level down) it tells me pretty much the same thing – and that <Directory” isn’t allowed in a subfolder.

    Currently, the .htaccess file looks like this:

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

    <Files .htaccess>
    order allow,deny
    deny from all
    </Files>

    DirectoryIndex index.php

    (I removed the <directory> stuff because every time I put it in, it would give the entire domain an internal server error – and although this is a site I’m currently working on and isn’t live, there *is* a live site on the server right now, and I can’t shut that down.)

    I’ve also tried changing the permissions of the .htaccess file to everything under the sun. Even left it at 777 for a while (although it’s currently at 644).

    Would anyone have any ideas on how I can edit this or fix it to get the permalinks working? I’m getting a headache from reading so much stuff out there and trying it out. (and to reiterate, I’ve already tried the stuff listed here.)

    Any ideas or help would be appreciated.

Viewing 15 replies - 1 through 15 (of 16 total)
  • I’m pretty sure that this

    RewriteBase /index.php/

    and this

    RewriteRule . /index.php/index.php [L]

    will cause errors. RewriteBase needs to be an actual directory.

    So if this .htaccess file is in the /blog/ directory, these lines should look like:

    RewriteBase /blog/

    RewriteRule . /blog/index.php [L]

    If the .htaccess file is in the top-level directory, then like this:

    RewriteBase /

    RewriteRule . /index.php [L]

    Are you sure mod_rewrite is working as it should. You could try adding a very simple rewrite rule, so you can rule that out..

    Thread Starter Doodlebee

    (@doodlebee)

    Actaully, I *did* try a test, and it didn’t work. I got an internal server error. I’ve just emailed to client so they could call the host and ensure that “AllowOverride” is turned on.

    In the meantime, filo, I was thinking that the ./index.php/index.php was part of the issue. Problem is, that’s what WordPress *gave* me to put in the .htaccess file. And I think it did that because of my setup. The WordPress files themselves are in the subfolder (www.sitenamehere.com/wordpress), but the actual *index* page for the site is in the root (www.sitenamehere.com) I had to place an index.php file in the root with the “require” statemt to get that to work.

    However, I now need to call back to the subfolder to pullin the data because I’m *also* creating a static index page that needs to be editable through WordPress.

    So I’m wondering if I’m just causing problem by creating this huge loop of crap with the going back and forth thing. I’m to the point now where I’m thinking of giving up the whole “creating static front page” and using the Loop to pull in what I need to do (i.e., make the template for the index page different than the rest of the site). Perhaps that will sove my problem.

    Again, we’ll see what the host says – and if anyone out there has tried to do what I’m doing, am I going about it the wrong way? Should I just rely on the Loop to provide an alternate index template? The only reason I’m using the “create a static index page” tutorial is because I just need that slightly altered template. Could this be the reson the permalinks aren’t working? (I hope my train of thought blabs is making sense, here!)

    Try this: put the .htaccess file, like so:

    RewriteBase /

    RewriteRule . /index.php [L]

    in the http://www.sitenamehere.com/ directory.

    Also in the http://www.sitenamehere.com/ directory should be an index.php file that looks like this:

    <?php
    /* Short and sweet */
    define('WP_USE_THEMES', true);
    require('./wordpress/wp-blog-header.php');
    ?>

    RE: static front whatever.
    Why not use a home.php template file – that always takes precedence over index (see Template Hierarchy in the Codex).
    You can do all kind of “magic” with the Loop on it… or (I did this several times) using the get_a_post plugin you can display some posts/Pages on it, all of them updatable via WP admin.

    Thread Starter Doodlebee

    (@doodlebee)

    I guess that verifies it – I got an internal server error. Error log states:

    [Fri Sep 8 11:18:32 2006] [alert] [client xx.xx.xx.xx] /usr/local/etc/httpd/vhosts/DOMAINNAMEHERE.org/htdocs/cms/.htaccess: Invalid command ‘RewriteRule’, perhaps mis-spelled or defined by a module not included in the server configuration

    Well crap. I asked that it be turned on, though – so hopefully they’ll do it. Thanks for the verification trick – I was trying to find on eof those because, so far, every time I ask a question it takes 2 days for them to respond! This was much faster.

    Edit: thanks Moshu (we must have posted at the same time). I’m already starting to get on this – reluctantly I guess. I keep adding conditionals, and it was just seeming to me that it would just be quicker to do exactly that! šŸ™‚

    RE: static front whatever.
    Why not use a home.php template file – that always takes precedence over index (see Template Hierarchy in the Codex).
    You can do all kind of “magic” with the Loop on it… or (I did this several times) using the get_a_post plugin you can display some posts/Pages on it, all of them updatable via WP admin.

    Or even simpler, just use my plugin to choose a static front page–no messing with theme files required.

    (That will have to be after you work out your permalink issues, though).

    Thread Starter Doodlebee

    (@doodlebee)

    I’m gonna leave this open for a little bit – because if they do turn it on (and they probably will) and I still have issues that I can’t work out, I’m coming back to this to ask more. But if they do turn it on, and it works fine, then I’ll come back and mark it resolved.

    I honestly felt like a doofus for even asking the question – and now that it’s because AllowOverride is turned off, I feel even dumber! But thanks a bunch for your help – and for putting up with some spazzing on my part. I really appreciate it.

    Thread Starter Doodlebee

    (@doodlebee)

    Well, I have returned. It is still not functioning properly. I tried (or verified that I had already done) the suggestions listed above. AllowOverride was turned on over the weekend, and the mod-rewrite is working just fine (tested it by changing all extensions to .html instead of .php – it did exactly that, no problems whatsoever).

    I even followed all suggestions in the cdex (linked in my first post) – down to completely deleting the .htaccess files and starting over. So, the .htaccess is doing it’s job just fine, but when you click on a link, it just returns a “Page not found”. When I look in the error logs, it says “X file does not exist”.

    I’m going to crawl through old posts on the forum again – maybe I’ve overlooked osmething – but if anyone has a suggestion in the meantime, I would appreciate it šŸ™‚

    Can you post your .htaccess file here?

    Thread Starter Doodlebee

    (@doodlebee)

    EDIT: that was too huge. I’ll just provide a link: htaccess file here

    I will also say that my own website runs in the same way I’ve set this one up. I have wordpress in subfolder and am using the trick with the index.php file in the root (you mentioned it above, with the wp-header stuff) so that the URL when you hit my site is “url.com” instead of “url.com/wordpress”.

    I tried taking *my* working .htaccess (my pretty permalinks work with no issue whatsoever) and looking ot see what was different between the two. Aside from the fact that my site has no Pages – only posts and categories – there was a part thay my .htaccess has that this one doesn’t:

    Options -Indexes
    Options +FollowSymlinks
    RewriteEngine on

    When I added that to the .htaccess file I’m working on now, it came up with a sitewide internal server error, and the error log showed an error of “Invalid command ‘RewriteEngine’…”

    I’ve emailed them again to BE SURE that mod-rewrite is turned on, but they’ve already said they turned it on over the weekend. So if it’s not that they are mistaken, what else could it be?

    (I really appreciate you all sticking with me on this one…it’s becoming a PITA!)

    Oh, and I also tried Moshu’s suggestion – nada as well. Didn’t do anything but mess up my index page (totally fixable, and it was to be expected, but it didn’t help, either!)

    Thread Starter Doodlebee

    (@doodlebee)

    Okay! New update (finally). I’m hoping someone here can translate tech-geek-speak.

    So, mod_rewrite wasn’t “on”. So I asked them to turn it on in the httpd.conf file (even I know how to do that! šŸ™‚ I just don’t have access to *theirs*!)

    Well, they asked the client to ask the server guy, and his response was as such:

    “Your programmer is attempting to use mod-rewrite in the .htaccess file and unfortunately the tech support guy said mod_rewrite won’t work on a VPS through the .htaccess. I’ll need to add his code to the VHOST area of the httpd.conf file.

    I attempted to place your code in the httpd.conf files and it’s still giving me errors.”

    *What* is VPS? and “VHOST”? I have no clue what this guy is saying! As far as I knew, all they have to do is uncomment two lines (“AddModule mod_rewrite.c” and “LoadModule rewrite_module modules/mod_rewrite.so”) – am I wrong on this? I honestly thought that was all that needed to be done to the file and mod_rewrite would run just fine.

    But adding the code directly to the httpd.conf file? That seems very odd to me.

    If anyone can translate this for me, I’d really appreciate it – because I have no clue what this guy is saying.

    Thanks!

    EDIT: wait…VPS – “Virtual Private Server”? Is that right? oh criminy, I hope that doesn’t mean they’re on a Windows server. They told me they were on *nix! Ugh.

    I think there’s a certain amount of confusion here.

    It sounds like a server running Apache to me, although it’s possible that a Windows server can run Apache; just never heard of it.

    A VPS is a virtual private server — a web server that has been split into a number of “virtual” private servers. It may be that your VPS has its own httpd.conf (the server configuration file).

    A VHOST is a virtual host; so far as I can tell, just a name they give to the domains being served on the server … that is, any domain outside of the htdocs directory; they’re usually in a directory named -you got it- vhosts.

    Now, mod_rewrite is a module that has to be installed on the server in order to be available for use. Then you call it in the httpd.conf (the server configuration file), but one normally doesn’t write the actual rules there (how messy is that?) — one writes them in the .htaccess file.

    So, it looks like you are right about uncommenting the two lines in the .conf (and you then have to upload it to the server and restart Apache). If you can SSH into the server (no one telnets anymore; it’s too insecure), log in and type this at the prompt:

    restart_apache

    then hit your return key. That will make the current contents of your httpd.conf file “take”.

    I feel for you, if you’re running into all these server/mod_rewrite issues just to get a blog running!

    Thread Starter Doodlebee

    (@doodlebee)

    Thanks for the explanation šŸ™‚

    Yes, they initally told me that they were on a *nix server running Apache – that’s why VPS is confusing me. And I thought all you had to do was uncomment those lines and restart Apache (that’s all I’ve ever had to do). Unfortunately, though – I don’t have access to SSH or anything. They won’t give me access to control panels or anything else, so I basically have to tell them what to do and have them do it, and hope they don’t screw it up.

    The blog is running just fine, actually – it’s just that they want “pretty permalinks” for the site – SEO purposes they say. They also want to retain their .html extension, as that’s what their site currently uses.

    It’s funny, though – I can rewrite all the pages to change the extensions from PHP to .html no problem – but the pretty permalinks just will not work.

    They also sent me to this link: http://faq.wordpress.net/view.php?p=20 and I’m wondering if the “<ifmodule mod_rewrite.c>” thing will work – turning it on through .htaccess rather than through the http.conf file. I guess I just have to find the right path to use, though…maybe that’s the issue.

    Urgh, I don’t know how I always get these clients that don’t know what’s going on, but don’t trust me enough to give me access to fix it. They’d rather me go through someone who has to go through someone who has to go through someone else. Oh well, at least they pay by the hour šŸ™‚

    Thread Starter Doodlebee

    (@doodlebee)

    Okay – I’ve gotten more information. Apparently, they are hosted by Verio. They are running a BSD/OS (not FreeBSD). Because of how the OS is partitioned, they can’t use the mod_rewrite in .htaccess. The tech guy has tried to add the stuff directly to the http.conf file, but it keeps giving him errors. I also don’t think this is a good idea, because if any new Pages are added, they’ll have to manually go in there and edit that file all the time, which will be annoying.

    I’m looking on the Verio site, and they say if you have BSD/OS, then you should upgrade. They give you instructions on upgrading, but I can’t find anything that tells you if this a free upgrade or not. If it’s free, I could tell them to just upgrade and, from the Verio documentation, it appears the problem would be solved and they could use .htaccess as they normally would. (IN fact, I think I’ll just have them look into doing that.)

    If they won’t upgrade, is there an alternative way anyone could share with me to get the mod_rewrite to function on this (apparently very weird) server? Or, alternatively, the only reason we’re doing this is for SEO. Would anyone have any documentation that shows that “pretty permalinks” won’t boost SEO anymore than the default ones? (Or that the regular links won’t hurt their rank as it is now?) I’m pretty sure it really doesn’t matter, but just *saying* that to them won’t hold water unless I have something to back it up.

Viewing 15 replies - 1 through 15 (of 16 total)

The topic ‘Pretty Permalinks Question’ is closed to new replies.