Web Hosting Forums

Results 1 to 14 of 14

This is a discussion on WordPress Permalink htaccess in the Hosting Talk & Chit-chat forum
Hey folks. I have installed WordPress on my site and have set up a custom permalink structure. Since WordPress could not edit the .htaccess file, ...

  1. #1
    Loyal Client
    Join Date
    Sep 2001
    Location
    Los Angeles
    Posts
    8

    WordPress Permalink htaccess

    Hey folks. I have installed WordPress on my site and have set up a custom permalink structure. Since WordPress could not edit the .htaccess file, it gave me the code to cut and paste. I did this using the cpanel Edit .htaccess link.

    The think is, it's not working, and I'm not sure why. I get a 404 error when trying to use the links. I have very little experience with this kind of programming (), and though I've looked through the forums and on other sites, I'm not sure what I am doing wrong. Is the code bad? Do I need to add something to the .htaccess file aside from what WordPress gave me? If anyone can help, I'd be astoundingly appreciative.

    The code given to me by WordPress follows. It is the only code in the .htaccess file.

    Thanks!

    --Steve

    <IfModule mod_rewrite.c>
    RewriteEngine On
    RewriteBase /wren_forum_new/
    RewriteCond %{REQUEST_FILENAME} -f [OR]
    RewriteCond %{REQUEST_FILENAME} -d
    RewriteRule ^.*$ - [S=35]
    RewriteRule ^feed/(feed|rdf|rss|rss2|atom)/?$ /wren_forum_new/index.php?&feed=$1 [QSA,L]
    RewriteRule ^(feed|rdf|rss|rss2|atom)/?$ /wren_forum_new/index.php?&feed=$1 [QSA,L]
    RewriteRule ^page/?([0-9]{1,})/?$ /wren_forum_new/index.php?&paged=$1 [QSA,L]
    RewriteRule ^comments/feed/(feed|rdf|rss|rss2|atom)/?$ /wren_forum_new/index.php?&feed=$1&withcomments=1 [QSA,L]
    RewriteRule ^comments/(feed|rdf|rss|rss2|atom)/?$ /wren_forum_new/index.php?&feed=$1&withcomments=1 [QSA,L]
    RewriteRule ^comments/page/?([0-9]{1,})/?$ /wren_forum_new/index.php?&paged=$1 [QSA,L]
    RewriteRule ^search/(.+)/feed/(feed|rdf|rss|rss2|atom)/?$ /wren_forum_new/index.php?s=$1&feed=$2 [QSA,L]
    RewriteRule ^search/(.+)/(feed|rdf|rss|rss2|atom)/?$ /wren_forum_new/index.php?s=$1&feed=$2 [QSA,L]
    RewriteRule ^search/(.+)/page/?([0-9]{1,})/?$ /wren_forum_new/index.php?s=$1&paged=$2 [QSA,L]
    RewriteRule ^search/(.+)/?$ /wren_forum_new/index.php?s=$1 [QSA,L]
    RewriteRule ^category/(.+)/feed/(feed|rdf|rss|rss2|atom)/?$ /wren_forum_new/index.php?category_name=$1&feed=$2 [QSA,L]
    RewriteRule ^category/(.+)/(feed|rdf|rss|rss2|atom)/?$ /wren_forum_new/index.php?category_name=$1&feed=$2 [QSA,L]
    RewriteRule ^category/(.+)/page/?([0-9]{1,})/?$ /wren_forum_new/index.php?category_name=$1&paged=$2 [QSA,L]
    RewriteRule ^category/(.+)/?$ /wren_forum_new/index.php?category_name=$1 [QSA,L]
    RewriteRule ^author/([^/]+)/feed/(feed|rdf|rss|rss2|atom)/?$ /wren_forum_new/index.php?author_name=$1&feed=$2 [QSA,L]
    RewriteRule ^author/([^/]+)/(feed|rdf|rss|rss2|atom)/?$ /wren_forum_new/index.php?author_name=$1&feed=$2 [QSA,L]
    RewriteRule ^author/([^/]+)/page/?([0-9]{1,})/?$ /wren_forum_new/index.php?author_name=$1&paged=$2 [QSA,L]
    RewriteRule ^author/([^/]+)/?$ /wren_forum_new/index.php?author_name=$1 [QSA,L]
    RewriteRule ^([0-9]{4})/feed/(feed|rdf|rss|rss2|atom)/?$ /wren_forum_new/index.php?year=$1&feed=$2 [QSA,L]
    RewriteRule ^([0-9]{4})/(feed|rdf|rss|rss2|atom)/?$ /wren_forum_new/index.php?year=$1&feed=$2 [QSA,L]
    RewriteRule ^([0-9]{4})/page/?([0-9]{1,})/?$ /wren_forum_new/index.php?year=$1&paged=$2 [QSA,L]
    RewriteRule ^([0-9]{4})/?$ /wren_forum_new/index.php?year=$1 [QSA,L]
    RewriteRule ^([0-9]{4})/([0-9]{1,2})/feed/(feed|rdf|rss|rss2|atom)/?$ /wren_forum_new/index.php?year=$1&monthnum=$2&feed=$3 [QSA,L]
    RewriteRule ^([0-9]{4})/([0-9]{1,2})/(feed|rdf|rss|rss2|atom)/?$ /wren_forum_new/index.php?year=$1&monthnum=$2&feed=$3 [QSA,L]
    RewriteRule ^([0-9]{4})/([0-9]{1,2})/page/?([0-9]{1,})/?$ /wren_forum_new/index.php?year=$1&monthnum=$2&paged=$3 [QSA,L]
    RewriteRule ^([0-9]{4})/([0-9]{1,2})/?$ /wren_forum_new/index.php?year=$1&monthnum=$2 [QSA,L]
    RewriteRule ^([0-9]{4})/([0-9]{1,2})/([0-9]{1,2})/feed/(feed|rdf|rss|rss2|atom)/?$ /wren_forum_new/index.php?year=$1&monthnum=$2&day=$3&fee d=$4 [QSA,L]
    RewriteRule ^([0-9]{4})/([0-9]{1,2})/([0-9]{1,2})/(feed|rdf|rss|rss2|atom)/?$ /wren_forum_new/index.php?year=$1&monthnum=$2&day=$3&fee d=$4 [QSA,L]
    RewriteRule ^([0-9]{4})/([0-9]{1,2})/([0-9]{1,2})/page/?([0-9]{1,})/?$ /wren_forum_new/index.php?year=$1&monthnum=$2&day=$3&pag ed=$4 [QSA,L]
    RewriteRule ^([0-9]{4})/([0-9]{1,2})/([0-9]{1,2})/?$ /wren_forum_new/index.php?year=$1&monthnum=$2&day=$3 [QSA,L]
    RewriteRule ^([0-9]{4})/([0-9]{1,2})/([0-9]{1,2})/([^/]+)/feed/(feed|rdf|rss|rss2|atom)/?$ /wren_forum_new/index.php?year=$1&monthnum=$2&day=$3&nam e=$4&feed=$5 [QSA,L]
    RewriteRule ^([0-9]{4})/([0-9]{1,2})/([0-9]{1,2})/([^/]+)/(feed|rdf|rss|rss2|atom)/?$ /wren_forum_new/index.php?year=$1&monthnum=$2&day=$3&nam e=$4&feed=$5 [QSA,L]
    RewriteRule ^([0-9]{4})/([0-9]{1,2})/([0-9]{1,2})/([^/]+)/page/?([0-9]{1,})/?$ /wren_forum_new/index.php?year=$1&monthnum=$2&day=$3&nam e=$4&paged=$5 [QSA,L]
    RewriteRule ^([0-9]{4})/([0-9]{1,2})/([0-9]{1,2})/([^/]+)(/[0-9]+)?/?$ /wren_forum_new/index.php?year=$1&monthnum=$2&day=$3&nam e=$4&page=$5 [QSA,L]
    RewriteRule ^([0-9]{4})/([0-9]{1,2})/([0-9]{1,2})/([^/]+)/trackback/?$ /wren_forum_new/index.php?year=$1&monthnum=$2&day=$3&nam e=$4&tb=1 [QSA,L]
    </IfModule>

  2. #2
    Old Hillbilly Connie's Avatar
    Join Date
    Sep 2001
    Location
    Hills of Missouri
    Posts
    2,491
    I'm not 100% sure but I think each rule of mod_rewrite has to be on 1 line. It could be that That the forum wrapped your copy and past. However if your text editor is wrapping the the lines turn that off and try again.

    Lot of experts here and I may be entirely off base.

  3. #3
    Loyal Client
    Join Date
    Sep 2001
    Location
    Los Angeles
    Posts
    8
    Thanks for the info. I took a look at that, and the entries are one line. It's the forum that's wrapping the text, it seems.

  4. #4
    Yeah, I know a LOT! Vin DSL's Avatar
    Join Date
    Mar 2003
    Location
    Arizona Uplands
    Posts
    10,661
    Quote Originally Posted by Lekowicz
    Hey folks. I have installed WordPress on my site and have set up a custom permalink structure. Since WordPress could not edit the .htaccess file, it gave me the code to cut and paste...
    Cool!

    I've been playing around with WordPress lately, but hadn't done the Permalinks thing yet. I figured, now is the time...

    http://lenon.info/

    If you want WordPress to do the work for you, all you need to do is change the permission on the .htaccess file to octal 666. Then, WordPress will write to it...
    DISCLAIMER Any resemblance between the views expressed above and those of the owners and operators of this system is purely coincidental. Any resemblance between these views and my own are non-deterministic. The existence of Vin DSL is questionable. The existence of views in the absence of anyone to hold them is problematic. The existence of the reader is left as an exercise in the second-order coefficient.

    No Guts, No Story! VinDSL 2010

  5. #5
    Loyal Client
    Join Date
    Sep 2001
    Location
    Los Angeles
    Posts
    8
    Well, your answer revealed a lot! The permission thing worked. But it turns out I had my .htaccess file in the wrong place. Changing the permissions showed me that error. Thank you very much! It seems to be working well now. If I have any other probs, I'll be back!

    (Oh, and in case anyone's worried, I changed the permissions back to 644. Don't want just any ol' one poking around in there!)

  6. #6
    Yeah, I know a LOT! Vin DSL's Avatar
    Join Date
    Mar 2003
    Location
    Arizona Uplands
    Posts
    10,661
    My pleasure!

    A couple of minutes ago, I upgraded Menalto Gallery2 Beta 4 -> version 1.0, and had to change its .htaccess octal to '666' also, to use their upgrade script, so this situation isn't unique to WordPress.

    LoL! I have .htaccess files all over the place. It's hard to keep them straight sometimes...
    DISCLAIMER Any resemblance between the views expressed above and those of the owners and operators of this system is purely coincidental. Any resemblance between these views and my own are non-deterministic. The existence of Vin DSL is questionable. The existence of views in the absence of anyone to hold them is problematic. The existence of the reader is left as an exercise in the second-order coefficient.

    No Guts, No Story! VinDSL 2010

  7. #7
    Yeah, I know a LOT! Vin DSL's Avatar
    Join Date
    Mar 2003
    Location
    Arizona Uplands
    Posts
    10,661
    Quote Originally Posted by Lekowicz
    (Oh, and in case anyone's worried, I changed the permissions back to 644. Don't want just any ol' one poking around in there!)
    BTW, if you'll pardon the pun, if you stick this in your .htaccess file, nobody can diddle with it...
    Code:
    <Files .htaccess>
    order allow,deny
    deny from all
    </Files>
    DISCLAIMER Any resemblance between the views expressed above and those of the owners and operators of this system is purely coincidental. Any resemblance between these views and my own are non-deterministic. The existence of Vin DSL is questionable. The existence of views in the absence of anyone to hold them is problematic. The existence of the reader is left as an exercise in the second-order coefficient.

    No Guts, No Story! VinDSL 2010

  8. #8
    Community Leader jason's Avatar
    Join Date
    Sep 2001
    Location
    Rochester, NY
    Posts
    5,884
    Quote Originally Posted by Vin DSL
    BTW, if you'll pardon the pun, if you stick this in your .htaccess file, nobody can diddle with it...
    Code:
    <Files .htaccess>
    order allow,deny
    deny from all
    </Files>
    Doesn't Apache automatically hide .htaccess files by default? I believe it does, but its been a while since I tweaked an httpd.conf file. Regardless, it never hurts to have redundancy in place for security purposes. It never hurts to have redundancy in place for security purposes.

    --Jason
    Jason Pitoniak
    Interbrite Communications
    www.interbrite.com www.kodiakskorner.com

  9. #9
    Loyal Client
    Join Date
    May 2002
    Location
    Northwest Florida
    Posts
    200
    Vin,

    I love your "Borderline Chaos" theme. The others ar just a bit too black for me.

    Jim
    Jim Winters
    Technology Lighthouse, Inc.
    Lighting the way for small business and nonprofit organizations.

  10. #10
    Yeah, I know a LOT! Vin DSL's Avatar
    Join Date
    Mar 2003
    Location
    Arizona Uplands
    Posts
    10,661
    Quote Originally Posted by techlighthouse
    Vin,

    I love your "Borderline Chaos" theme. The others are just a bit too black for me.

    Jim
    Thanks!

    I've worked with 'black' themes a lot. Black is the only color that interests me, and there are a few tricks to making it look right. I only use 'color' when there is a reason for it.

    If the dimensions/color of my default WordPress theme look odd to you, it's because I plan to port WordPress over to a PHP-Nuke module, to replace the worthless Journal module.
    DISCLAIMER Any resemblance between the views expressed above and those of the owners and operators of this system is purely coincidental. Any resemblance between these views and my own are non-deterministic. The existence of Vin DSL is questionable. The existence of views in the absence of anyone to hold them is problematic. The existence of the reader is left as an exercise in the second-order coefficient.

    No Guts, No Story! VinDSL 2010

  11. #11
    || $name ne 'R.Stiltskin'
    Join Date
    Jun 2003
    Location
    Tejas
    Posts
    2,414
    Quote Originally Posted by jason
    Doesn't Apache automatically hide .htaccess files by default? I believe it does, but its been a while since I tweaked an httpd.conf file.
    Yes, it does.
    Code:
    # In httpd.conf, use:
    AccessFileName .htaccess
    <Files ~ "^\.ht">
        Order allow,deny
        Deny from all
    </Files>
    In Apache 1.3 and later, <FilesMatch> is preferred. So, for redundancy redundancy, use:
    Code:
    # Regex the following --> <FilesMatch "\.ht(access|passwd|group)$">
    <FilesMatch "^\.ht">
        Deny from All
    </FilesMatch>
    I add the <FilesMatch> directive in my root .htaccess to cover the bases.

    For those unfamiliar with regular expressions, the ^ (carat) indicates the start of any file (word), the \ (backslash) indicates an "escape" so that the character following it [in this case, a period] is a normal character and not a special, "match anything" indicator, and the "ht" indicates the starting characters of the file (word) to be matched.
    Last edited by Spathiphyllum; 09-24-2005 at 10:53 PM. Reason: Clarify Perlish regex expression in .htaccess directives

  12. #12
    Yeah, I know a LOT! Vin DSL's Avatar
    Join Date
    Mar 2003
    Location
    Arizona Uplands
    Posts
    10,661
    Quote Originally Posted by Spathiphyllum
    So, for redundancy redundancy, use..
    Heh! Cute!
    DISCLAIMER Any resemblance between the views expressed above and those of the owners and operators of this system is purely coincidental. Any resemblance between these views and my own are non-deterministic. The existence of Vin DSL is questionable. The existence of views in the absence of anyone to hold them is problematic. The existence of the reader is left as an exercise in the second-order coefficient.

    No Guts, No Story! VinDSL 2010

  13. #13
    || $name ne 'R.Stiltskin'
    Join Date
    Jun 2003
    Location
    Tejas
    Posts
    2,414
    Quote Originally Posted by Vin DSL
    Heh! Cute!
    Read it quickly enough and you mississ it.

  14. #14
    Community Leader jason's Avatar
    Join Date
    Sep 2001
    Location
    Rochester, NY
    Posts
    5,884
    Quote Originally Posted by Spathiphyllum
    Read it quickly enough and you mississ it.
    You never mississ a chance, do you?

    --Jason
    Jason Pitoniak
    Interbrite Communications
    www.interbrite.com www.kodiakskorner.com

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •