• Here is my problem:

    I’ve created “pages” in my wordpress installation and now would like use cleaner URI’s, ie. point the pages to directories.

    My wordpress installation did not create an .htaccess file so I create a blank .htaccess file, upload it, and CHMOD it to 666. I then go into my WP admin and change the permalink structure. When I do this I get a “Forbidden” error on the site.

    If someone is familiar with this problem please let me know how I can fix it. Maybe i’m using the wrong permalink structure? Or maybe I have to add some extra code to the .htaccess file that I don’t know about?

    I’m hosting the site on mediatemple if that helps diagnose the problem at all.

Viewing 12 replies - 16 through 27 (of 27 total)
  • I think I just figured out what’s happening with my similar problem:

    First, this is how my site is set up (it’s on a lan, so the urls will be invalid)

    Options > General page:
    WP address: https://justfocus.dev/articles
    Blog address: https://justfocus.dev/articles

    General > Permalinks:
    Structure: /%year%/%monthnum%/%day%/%postname%/
    Category Base: /categories

    There is a hidden option which throws spanners in the works, so check it to be sure:
    In the wp_options table there is an option called blogfilename. Mine is set to /articles/

    Right. Now the problem is that even though my blog is set up in /articles/, WP insists on writing to /.htaccess for it’s permalink structure. I think I solved it by

    1. moving /.htaccess to /articles/.htaccess
    2. manually editing /articles/.htaccess and replacing all occurances of /index.php? with /articles/index.php?.

    WordPress still thinks the blog homepage is at /articles/, but because I’m using a heavily modified theme, it’s not affecting me yet.

    >>Bottom line is that I had to set the FollowSymLinks directive to yes in >>Apache. It didn’t work in the .htaccess file.

    Can you explain how you do this in Apache?
    I have no knowledge on how to load, edit or do anything in Apache?
    If you could explain in laymans terms that would be great ??

    ==================

    This may be a hard thing to answer if you do not use virtual hosts. Check with your host if you do not manage your server on your own.

    If you want you can get back with me to let me know you specific setup and I can see if I can help you figure it out.

    Kathy

    Here’s what I did when I got just about every single problem posted on this page.

    1) Make a .htaccess file, but leave it blank.
    2) Upload it into the directory your WP index.php page is.
    3) Change chmod of the .htaccess to 777
    4) Update permalinks
    5) Change chmod of .taccess back to 644 (for your own protection)

    It should work now. Hope this helps.

    I’ve struggled with this for a couple of days and finally got it to work using exactly the same steps as the poster above but with the addition of one step:

    4b) edit the .htaccess file generated by wordpress and add the line Options +Followsymlinks so that the first three lines of this file now read:

    <IfModule mod_rewrite.c>
    Options +Followsymlinks
    RewriteEngine On

    (There’s no point adding this line before WP updates the .htaccess file: you addition will just be overwritten.)

    This is assuming of course that Apache is configured to allow .htaccess files. You need AllowOverride to be set to All in your /etc/apache2/httpd.conf and .htaccess to be defined as the name of the file that can override the default settings. The section should look something like this:

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

    # use .htaccess files for overriding,
    AccessFileName .htaccess

    Hope this helps someone

    Tim

    Both Tim and Viitoria, I can’t tell you how much that helped: there are so many places online that give hints at how to edit a .htaccess file, but don’t really actually show you what’s going on. Now, after over 24 hours of on and off looking online for an education in Apache rules, I think I’ve got everything sorted.

    The most grateful thanks to you both.

    Patrick

    I have a similiar problem.

    The htaccess file is created and update correctly.

    When i set a perm link, the link it self seems to work, but i only get the title of the document. Not the document body.

    I can’t seem to find this error noted anywhere.

    kelvin

    On a side note. I’ve had similar problems with WP and .htaccess and I noticed that it was basically at one location (meaning: it was always the same hosting company) Double check with them HOW they have rewrite_mod installed and configured. At this particular hosting facility you actually had to turn on all the options just to use ONE of the features. So you might try putting this at the very top of your htaccess file: “options all”.

    Hope that helps

    great info here. like many i’ve been struggling with this for a long time. finally adding Options +Followsymlinks solved the problem.
    I just have one tip to add though that I haven’t seen mentioned yet.
    adding Options +Followsymlinks to .htaccess solved the problem, but i would have to close off the permissions so that wordpress couldn’t ovewrite it again (if for example i decided to change my permalinks again). i wanted a way to have wordpress generate the right code everytime without having to manually add it. so i went into wp-includes > classes.php and added this line $rules .= "Options +Followsymlinksn";
    between these two original lines:

    $rules = "<IfModule mod_rewrite.c>n";
    $rules .= "RewriteEngine Onn";

    now it writes the code correctly everytime. no need to mess with the .htaccess file. My knowledge of php is zero and i am knew to wordpress so if there is a smatter way to do this or i have done something silly i am eager to know. so far so good though. hope this helps somebody else.

    702

    (@702)

    Holla,

    Pretty much replies in this topic but unfortunately they can’t solve my problems…
    It’s really simple: on my host (uw.hu) .htaccess is a not supported file… any ideas how to get out of this sad situation?

    thanx a lot: 702

    mtupper

    (@mtupper)

    Wouldnt you know it… I have tried everything here. Tim, Victoria, PoultryFarm, etc… and still no dice! I am at my wits end. I have one nagging suspition that it has to do with the mod_rewrite issue with apache2. I guess what it comes down to is that I am not exactly sure how to be sure that this is installed and running on my Apache2 server. Can someone explain in more detail??

    I have tried the directives in the apache2.conf
    I have copied the rewrite.load from mods_available to mods_enabled
    I have played with the .htaccess every which way

    My setup: Apache2, PHP5, MySQL 4.1

    Funny thing is, I am developing my site on my laptop and I have already contracted hosting on GoDaddy to upload it there when I finish the major mods to the theme etc… and after going at this for 2 days to get pretty permalinks to work, I just read a another post here explaining why this wont work on GoDaddy because they dont allow the mod_rewrite to work on there servers. But I feel I have come this far, I must resolve this anyway!!!

    mtupper

    (@mtupper)

    UNBELIEVABLE…

    About 45 Seconds after posting the last one… I got it to work!!!

    The problem was: I was focused 100% on the apache2.conf file to ensure the AllowOverride All was set in the <Directory />…

    But I failed to realize there is ANOTHER config file of importance, one with the <VirtualHost> which was at /etc/apache2/sites_enabled/default000

    ARRRGGG!!!

    Thanks for everbody’s postings here… the solution is here somewhere.

    dax702

    (@dax702)

    For anyone wondering, this .htaccess will work fine on Godaddy if you’re on their deluxe hosting plan.

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

    # END WordPress

    Make sure that the file is in the root directory of wordpress and you may have to wait up to an hour for the change to take effect for whatever reason.

Viewing 12 replies - 16 through 27 (of 27 total)
  • The topic ‘.htaccess & Permalinks Problem’ is closed to new replies.