WordPress.org

Ready to get started?Download WordPress

Forums

[resolved] Permalinks not working (23 posts)

  1. Spartacus
    Member
    Posted 8 years ago #

    Hi, I'm trying to make my wp permalinks backwards-compatable with my old blogger permalinks that all the search engines reference. I am able to make the permalinks like this:

    http://spartacus.drogers.net/index.php/2005/12/pink-ribbons-jlh.html

    But what I really need is this:

    http://spartacus.drogers.net/2005/12/pink-ribbons-jlh.html

    Sans "index.php"

    I've looked around on my server and I don't see wp changing an .htaccess file at all. Any help would be appreciated.

  2. moshu
    Member
    Posted 8 years ago #

    Unless you are on a Win server or a server without mod_rewrite - you don't really need the index.php in the permalink structure. That's the first step to figure out.

    If you have mod_rewrite then while updating your permalinks structure in the admin panel (Options > Permalinks) WP will tell you whether it was able to write the .htaccess file or you have to do it manually.
    Just make an empty file and upload it to the root and make it writable (chmod 666).

  3. Spartacus
    Member
    Posted 8 years ago #

    I'm on a Linux server. I have .htaccess files in both public_html of the main site, and the directory for the subdomain, /spartacus. Neither of them change when I change the permalink structure, but /index.php/... works and /... doesn't. Both files are mode 666. WP simply says "permalinks updated succesfully."

  4. moshu
    Member
    Posted 8 years ago #

    Just to test (and BTW, WP will write only the one in its directory!) - make the WP's .htaccess file totally un-writable and update the permalink options in the admin. WP should show you the code; copy and paste it manually into the .htaccess file, upload it and see if it works.

  5. mmcclary
    Member
    Posted 8 years ago #

    Sorry to pile on here but I'm having the identical problem. I've tried all the steps and have no permalinks. Well, I have permalinks but they only link to the most recent blog post on the blog. Also, when I click on an Archive month, it takes me to that same top-of-blog post.

  6. First, make sure that your .htaccess file's permissions are set to 666 (CHMOD 666), then try this permalink structure:

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

    If that doesn't work, try this:

    /index.php/%year%/%monthnum%/%day%/%postname%/

  7. lodar
    Member
    Posted 8 years ago #

    Hi, some of my permalinks suddenly stopped to work.
    I tried this structure:
    /%year%/%monthnum%/day%/%postname%
    (without last slash) and that helped.
    But i have still problems with calendar because /%year%/%monthnum%/%day%/ doesn't work while /%year%/%monthnum%/%day% works... so you have to remove the last slash every time using the calendar.

  8. Spartacus
    Member
    Posted 8 years ago #

    The .htaccess file will not change to 444 but only 644. Even at that, the file is never modified or written to when I change the permalink structure.

    Unless I am mistaken, a new problem has arisen. When I change the structure to /... nothing works, when it's index.php/... everything just goes back to the main page.

  9. moshu
    Member
    Posted 8 years ago #

    666 not 444.

  10. binfeed
    Member
    Posted 8 years ago #

    moshu:

    I'm fairly certain most people are NOT having permission problems. I am suffering with the same problem. You can see the problem in action at http://jeff.binaryfeed.net/

    Permalinks of this form work:

    /index.php/%year%/%monthnum%/%day%/%postname%/

    Permalinks of this form DON'T work:

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

    My .htaccess file looks like this:

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

    My mod_rewrite logs are as follows:

    <IP removed> - - [29/Dec/2005:21:13:26 --0600] [jeff.binaryfeed.net/sid#81a85f0][rid#82842d0/initial] (2) [per-dir /var/kunden/webs/jeff/jeff.binaryfeed.net/] rewrite 2005/12/29/irc-im-speak/ -> /index.php
    <IP removed> - - [29/Dec/2005:21:13:26 --0600] [jeff.binaryfeed.net/sid#81a85f0][rid#82842d0/initial] (2) [per-dir /var/kunden/webs/jeff/jeff.binaryfeed.net/] trying to replace prefix /var/kunden/webs/jeff/jeff.binaryfeed.net/ with /
    <IP removed> - - [29/Dec/2005:21:13:26 --0600] [jeff.binaryfeed.net/sid#81a85f0][rid#82842d0/initial] (1) [per-dir /var/kunden/webs/jeff/jeff.binaryfeed.net/] internal redirect with /index.php [INTERNAL REDIRECT]
    <IP removed> - - [29/Dec/2005:21:13:26 --0600] [jeff.binaryfeed.net/sid#81a85f0][rid#8283b60/initial/redir#1] (1) [per-dir /var/kunden/webs/jeff/jeff.binaryfeed.net/] pass through /var/kunden/webs/jeff/jeff.binaryfeed.net/index.php
    <IP removed> - - [29/Dec/2005:21:13:26 --0600] [jeff.binaryfeed.net/sid#81a85f0][rid#827c2b8/initial] (1) [per-dir /var/kunden/webs/jeff/jeff.binaryfeed.net/] pass through /var/kunden/webs/jeff/jeff.binaryfeed.net/favicon.ico

  11. binfeed
    Member
    Posted 8 years ago #

    For all those with the same problem I've described above, the following is a workaround. It sucks, because it does an external redirect and I'm not sure how that affects search engines, etc. But for those of us who've moved to WordPress 2.0 only to find permalinks broken, here's a temporary solution:

    Change your .htaccess file to look like this:

    # BEGIN WordPress
    <IfModule mod_rewrite.c>
    RewriteEngine On
    RewriteBase /
    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteCond %{REQUEST_FILENAME} !-d
    RewriteRule ^(.*)$ /index.php/$1 [R,L]
    </IfModule>
    # END WordPress

  12. Spartacus
    Member
    Posted 8 years ago #

    Thanks binfeed that redirect works great. The only problem now is that all the links redirect to the main page. Whether it's %postname%/ or %postname%.html everything goes to the main page.

  13. binfeed
    Member
    Posted 8 years ago #

    For all those who are interested, the bug I was seeing above had *nothing* to do with WordPress. It was actually a PHP bug. Changing "display_startup_errors" to "On" in php.ini allowed me to see that require_once() was not working properly under PHP 4.4.1. I then found this bug:

    http://bugs.php.net/bug.php?id=35059

    I downgraded to PHP 4.3.10 and all is well.

  14. freek
    Member
    Posted 8 years ago #

    Lodar,

    I had the same problem with permalinks and the calendar and found following solution:
    open the template-functions-links.php file in wp-includes directory, and change line 172 from
    return apply_filters('day_link', get_settings('home') . trailingslashit($daylink), $year, $month, $day);
    to
    return substr(apply_filters('day_link', get_settings('home') . trailingslashit($daylink), $year, $month, $day),0,-1);

    I also had to add "Options +SymLinksIfOwnerMatch" to the top of my .htacces file

  15. dirx
    Member
    Posted 8 years ago #

    My workaround:
    Change line 864 in /wp-includes/classes.php from:

    var $use_verbose_rules = false;

    to:

    var $use_verbose_rules = true;

    if you change this all extra rewrite rules are added to your .htaccess.

    use_verbose_rules is used in the function mod_rewrite_rules() (starts at line 1334). it´s not set anywhere else. there is no mapping in the options database table. seems to be not finished yet...

    hope this helps.

  16. apolaine
    Member
    Posted 8 years ago #

    Yes, I'm having the same problem but neither of the above workarounds worked for me, also I'm not able to downgrade my PHP version. It only happens on one permalink (ironically the one about upgrading to WP 2.0.

    The broken permalink is: http://www.polaine.com/playpen/2006/01/01/playpen-upgraded-to-wordpress-20/

    The numerical page number (which works) is http://www.polaine.com/playpen/?p=119

  17. moshu
    Member
    Posted 8 years ago #

    apolaine,
    I think this post explains your ptoblem's cause:
    http://wordpress.org/support/topic/53244/page/2?replies=43#post-296262

  18. apolaine
    Member
    Posted 8 years ago #

    Moshu, yes, thanks for that, the actual solution was in the patch from Ryan. It was probably a redirect that I have going on, though I'm still not really sure exactly what the problem was.

    However, the patch fixed is, others can find it here: http://wordpress.org/support/topic/54340

  19. Spartacus
    Member
    Posted 8 years ago #

    Okay, I updated to wp 2.0, modified my .htaccess to rewrite the index.php, everything seems to be working fine, my old links from blogger are working at last, but I am unable to edit or publish new pages. Saving as drafts works fine, but when I try to publish I get the following error.

    Warning: weblog_ping(/home/drogersn/public_html/spartacus/wp-includes/class-IXR.php) [function.weblog-ping]: failed to open stream: No such file or directory in /home/drogersn/public_html/spartacus/wp-includes/functions.php on line 843

    Warning: weblog_ping() [function.include]: Failed opening '/home/drogersn/public_html/spartacus/wp-includes/class-IXR.php' for inclusion (include_path='.:/usr/lib/php:/usr/local/lib/php') in /home/drogersn/public_html/spartacus/wp-includes/functions.php on line 843

    Fatal error: Class 'IXR_Client' not found in /home/drogersn/public_html/spartacus/wp-includes/functions.php on line 846

  20. annehill
    Member
    Posted 8 years ago #

    Okay, I'll pipe in with my particular version of this problem. I upgraded to wp2, and kept the .htaccess file in my main directory, not the wp subdirectory. Then I changed my permalink option from the default to the next one down on the page. I got a permission denied warning and my site stopped loading at all. I noticed via ftp that there was now a .htaccess file in the wp subdirectory. Deleted that, then went back to permalink options and tried to undo the damage, but the same thing happened again.

    Now my site is up but barely. If I try to click on the comments for any post, I get:

    Warning: main(/nfs/www/WWW_pages/annehill/gnosiscafe.com/gcblog/wp-config.php): failed to open stream: Permission denied in /nfs/www/WWW_pages/annehill/gnosiscafe.com/gcblog/wp-blog-header.php on line 12

    I'm too much of a php neophyte to know whether the fixes posted earlier in this thread would help in my situation. Can someone please tell me how to edit the config file and/or .htaccess so I can get up and running again? (I'd like to keep the change in permalink style, but wonder whether it will be backward compatible with earlier links people have posted on their sites.)

    Thanks,
    Anne
    http://www.gnosiscafe.com/gcblog

  21. johnny_838
    Member
    Posted 8 years ago #

    Hello everyone,
    I am new to wordpress.

    I have recently created a blog http://www.gadioc.com and the change of perma link structure worked correctly.

    but I created a subdomain later http://resources.gadioc.com ,
    and when i changed the perma link structure from default to /%year%/%monthnum%/%day%/%postname%/ it is not working and i am getting 404 error. try to help me????

  22. Spartacus
    Member
    Posted 8 years ago #

    Okay, turns out that my error about class-IXR.php was caused by simple case missmatch. If anyone else has the same problem, the file MUST be named class-IXR.php, class-ixr.php will give you problems.

    I'm setting this thread to resolved since my original issue with permalinks has been fixed.

  23. moshu
    Member
    Posted 8 years ago #

    @johnny_838,
    Because your subdomain is "cheating" - it redirects to a folder with the same name. Eliminate the redirect, if your server setup permits it.

Topic Closed

This topic has been closed to new replies.

About this Topic