WordPress.org

Forums

Day and name Permalinks results in 404 error (61 posts)

  1. Basetwo
    Member
    Posted 6 years ago #

    Hey everyone,

    I'm having the same problems as most of you seem to have. my custom structure is:
    /%category%/%postname%/

    just to make sure that it wasn't server sided, I emailed my hosting service and this was the answer they provided:

    Dear anhosting. I want to use my wordpress to create "Pretty Links". The requirements for this however are:

    # Apache web server with the mod_rewrite module installed
    # In WordPress's home directory,
    * The FollowSymLinks option enabled
    * FileInfo directives allowed (e.g. AllowOverride FileInfo, AllowOverride All)

    Does my hosting plan meet these requirements?

    to which they replied:

    Hello,

    Modrewrite and Fileinfo directives are enabled in the server.

    I don't have a wordpress 2.6.5 set up so i cannot use phpMyAdmin to fetch the values from the database.

    As far as I know, all the settings are correct. WP made a .htacces file into which I edited the line options +followsymlinks in to see if it had any effect.

    this is my htacces file.

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

    /end rant, will keep checking back the topic and good luck to everyone with the same problem :)

  2. Basetwo
    Member
    Posted 6 years ago #

    smrtalex: could you please show me what you've pasted in the rewrite_rules table? i dont know if its any use, but this is what was in my rewrite_rules table

    edit: actually i just removed it since its just a load of info that's probably useless. i just realized i probably cant use the info you put in your table. oh well

  3. smrtalex
    Member
    Posted 6 years ago #

    This is the values from 2.6.5 that I posted in the 2.7 database. Hope it helps you! Make sure it is one line, no word wrap. :) Let us know. Thanks!

    a:63:{s:11:"robots.txt$";s:18:"index.php?robots=1";s:14:".*wp-atom.php$";s:19:"index.php?feed=atom";s:13:".*wp-rdf.php$";s:18:"index.php?feed=rdf";s:13:".*wp-rss.php$";s:18:"index.php?feed=rss";s:14:".*wp-rss2.php$";s:19:"index.php?feed=rss2";s:14:".*wp-feed.php$";s:19:"index.php?feed=feed";s:22:".*wp-commentsrss2.php$";s:34:"index.php?feed=rss2&withcomments=1";s:32:"feed/(feed|rdf|rss|rss2|atom)/?$";s:27:"index.php?&feed=$matches[1]";s:27:"(feed|rdf|rss|rss2|atom)/?$";s:27:"index.php?&feed=$matches[1]";s:20:"page/?([0-9]{1,})/?$";s:28:"index.php?&paged=$matches[1]";s:41:"comments/feed/(feed|rdf|rss|rss2|atom)/?$";s:42:"index.php?&feed=$matches[1]&withcomments=1";s:36:"comments/(feed|rdf|rss|rss2|atom)/?$";s:42:"index.php?&feed=$matches[1]&withcomments=1";s:29:"comments/page/?([0-9]{1,})/?$";s:28:"index.php?&paged=$matches[1]";s:44:"search/(.+)/feed/(feed|rdf|rss|rss2|atom)/?$";s:40:"index.php?s=$matches[1]&feed=$matches[2]";s:39:"search/(.+)/(feed|rdf|rss|rss2|atom)/?$";s:40:"index.php?s=$matches[1]&feed=$matches[2]";s:32:"search/(.+)/page/?([0-9]{1,})/?$";s:41:"index.php?s=$matches[1]&paged=$matches[2]";s:14:"search/(.+)/?$";s:23:"index.php?s=$matches[1]";s:47:"category/(.+?)/feed/(feed|rdf|rss|rss2|atom)/?$";s:52:"index.php?category_name=$matches[1]&feed=$matches[2]";s:42:"category/(.+?)/(feed|rdf|rss|rss2|atom)/?$";s:52:"index.php?category_name=$matches[1]&feed=$matches[2]";s:35:"category/(.+?)/page/?([0-9]{1,})/?$";s:53:"index.php?category_name=$matches[1]&paged=$matches[2]";s:17:"category/(.+?)/?$";s:35:"index.php?category_name=$matches[1]";s:42:"tag/(.+?)/feed/(feed|rdf|rss|rss2|atom)/?$";s:42:"index.php?tag=$matches[1]&feed=$matches[2]";s:37:"tag/(.+?)/(feed|rdf|rss|rss2|atom)/?$";s:42:"index.php?tag=$matches[1]&feed=$matches[2]";s:30:"tag/(.+?)/page/?([0-9]{1,})/?$";s:43:"index.php?tag=$matches[1]&paged=$matches[2]";s:12:"tag/(.+?)/?$";s:25:"index.php?tag=$matches[1]";s:47:"author/([^/]+)/feed/(feed|rdf|rss|rss2|atom)/?$";s:50:"index.php?author_name=$matches[1]&feed=$matches[2]";s:42:"author/([^/]+)/(feed|rdf|rss|rss2|atom)/?$";s:50:"index.php?author_name=$matches[1]&feed=$matches[2]";s:35:"author/([^/]+)/page/?([0-9]{1,})/?$";s:51:"index.php?author_name=$matches[1]&paged=$matches[2]";s:17:"author/([^/]+)/?$";s:33:"index.php?author_name=$matches[1]";s:69:"([0-9]{4})/([0-9]{1,2})/([0-9]{1,2})/feed/(feed|rdf|rss|rss2|atom)/?$";s:80:"index.php?year=$matches[1]&monthnum=$matches[2]&day=$matches[3]&feed=$matches[4]";s:64:"([0-9]{4})/([0-9]{1,2})/([0-9]{1,2})/(feed|rdf|rss|rss2|atom)/?$";s:80:"index.php?year=$matches[1]&monthnum=$matches[2]&day=$matches[3]&feed=$matches[4]";s:57:"([0-9]{4})/([0-9]{1,2})/([0-9]{1,2})/page/?([0-9]{1,})/?$";s:81:"index.php?year=$matches[1]&monthnum=$matches[2]&day=$matches[3]&paged=$matches[4]";s:39:"([0-9]{4})/([0-9]{1,2})/([0-9]{1,2})/?$";s:63:"index.php?year=$matches[1]&monthnum=$matches[2]&day=$matches[3]";s:56:"([0-9]{4})/([0-9]{1,2})/feed/(feed|rdf|rss|rss2|atom)/?$";s:64:"index.php?year=$matches[1]&monthnum=$matches[2]&feed=$matches[3]";s:51:"([0-9]{4})/([0-9]{1,2})/(feed|rdf|rss|rss2|atom)/?$";s:64:"index.php?year=$matches[1]&monthnum=$matches[2]&feed=$matches[3]";s:44:"([0-9]{4})/([0-9]{1,2})/page/?([0-9]{1,})/?$";s:65:"index.php?year=$matches[1]&monthnum=$matches[2]&paged=$matches[3]";s:26:"([0-9]{4})/([0-9]{1,2})/?$";s:47:"index.php?year=$matches[1]&monthnum=$matches[2]";s:43:"([0-9]{4})/feed/(feed|rdf|rss|rss2|atom)/?$";s:43:"index.php?year=$matches[1]&feed=$matches[2]";s:38:"([0-9]{4})/(feed|rdf|rss|rss2|atom)/?$";s:43:"index.php?year=$matches[1]&feed=$matches[2]";s:31:"([0-9]{4})/page/?([0-9]{1,})/?$";s:44:"index.php?year=$matches[1]&paged=$matches[2]";s:13:"([0-9]{4})/?$";s:26:"index.php?year=$matches[1]";s:58:"[0-9]{4}/[0-9]{1,2}/[0-9]{1,2}/[^/]+/attachment/([^/]+)/?$";s:32:"index.php?attachment=$matches[1]";s:68:"[0-9]{4}/[0-9]{1,2}/[0-9]{1,2}/[^/]+/attachment/([^/]+)/trackback/?$";s:37:"index.php?attachment=$matches[1]&tb=1";s:88:"[0-9]{4}/[0-9]{1,2}/[0-9]{1,2}/[^/]+/attachment/([^/]+)/feed/(feed|rdf|rss|rss2|atom)/?$";s:49:"index.php?attachment=$matches[1]&feed=$matches[2]";s:83:"[0-9]{4}/[0-9]{1,2}/[0-9]{1,2}/[^/]+/attachment/([^/]+)/(feed|rdf|rss|rss2|atom)/?$";s:49:"index.php?attachment=$matches[1]&feed=$matches[2]";s:57:"([0-9]{4})/([0-9]{1,2})/([0-9]{1,2})/([^/]+)/trackback/?$";s:85:"index.php?year=$matches[1]&monthnum=$matches[2]&day=$matches[3]&name=$matches[4]&tb=1";s:77:"([0-9]{4})/([0-9]{1,2})/([0-9]{1,2})/([^/]+)/feed/(feed|rdf|rss|rss2|atom)/?$";s:97:"index.php?year=$matches[1]&monthnum=$matches[2]&day=$matches[3]&name=$matches[4]&feed=$matches[5]";s:72:"([0-9]{4})/([0-9]{1,2})/([0-9]{1,2})/([^/]+)/(feed|rdf|rss|rss2|atom)/?$";s:97:"index.php?year=$matches[1]&monthnum=$matches[2]&day=$matches[3]&name=$matches[4]&feed=$matches[5]";s:65:"([0-9]{4})/([0-9]{1,2})/([0-9]{1,2})/([^/]+)/page/?([0-9]{1,})/?$";s:98:"index.php?year=$matches[1]&monthnum=$matches[2]&day=$matches[3]&name=$matches[4]&paged=$matches[5]";s:57:"([0-9]{4})/([0-9]{1,2})/([0-9]{1,2})/([^/]+)(/[0-9]+)?/?$";s:97:"index.php?year=$matches[1]&monthnum=$matches[2]&day=$matches[3]&name=$matches[4]&page=$matches[5]";s:47:"[0-9]{4}/[0-9]{1,2}/[0-9]{1,2}/[^/]+/([^/]+)/?$";s:32:"index.php?attachment=$matches[1]";s:57:"[0-9]{4}/[0-9]{1,2}/[0-9]{1,2}/[^/]+/([^/]+)/trackback/?$";s:37:"index.php?attachment=$matches[1]&tb=1";s:77:"[0-9]{4}/[0-9]{1,2}/[0-9]{1,2}/[^/]+/([^/]+)/feed/(feed|rdf|rss|rss2|atom)/?$";s:49:"index.php?attachment=$matches[1]&feed=$matches[2]";s:72:"[0-9]{4}/[0-9]{1,2}/[0-9]{1,2}/[^/]+/([^/]+)/(feed|rdf|rss|rss2|atom)/?$";s:49:"index.php?attachment=$matches[1]&feed=$matches[2]";s:25:".+?/attachment/([^/]+)/?$";s:32:"index.php?attachment=$matches[1]";s:35:".+?/attachment/([^/]+)/trackback/?$";s:37:"index.php?attachment=$matches[1]&tb=1";s:55:".+?/attachment/([^/]+)/feed/(feed|rdf|rss|rss2|atom)/?$";s:49:"index.php?attachment=$matches[1]&feed=$matches[2]";s:50:".+?/attachment/([^/]+)/(feed|rdf|rss|rss2|atom)/?$";s:49:"index.php?attachment=$matches[1]&feed=$matches[2]";s:18:"(.+?)/trackback/?$";s:35:"index.php?pagename=$matches[1]&tb=1";s:38:"(.+?)/feed/(feed|rdf|rss|rss2|atom)/?$";s:47:"index.php?pagename=$matches[1]&feed=$matches[2]";s:33:"(.+?)/(feed|rdf|rss|rss2|atom)/?$";s:47:"index.php?pagename=$matches[1]&feed=$matches[2]";s:26:"(.+?)/page/?([0-9]{1,})/?$";s:48:"index.php?pagename=$matches[1]&paged=$matches[2]";s:18:"(.+?)(/[0-9]+)?/?$";s:47:"index.php?pagename=$matches[1]&page=$matches[2]";}

  4. Basetwo
    Member
    Posted 6 years ago #

    thank you smrtalex. I edited the info in the phpmyadmin value.
    haha, after some testing i realized that posts still do not work, (sorry for linking my site, will remove if needed):

    http://www.signaturestop.com/signaturetutorials/hello-world/

    this was the first post in the signaturetutorials category, and gives a 404. however, if i want to view all posts in a certain category:

    http://www.signaturestop.com/category/signaturetutorials/

    does work!! this link used to be http://www.signaturestop.com/?cat=4 and now automatically redirects to the rewritten link

    so it worked to a certain extend, i still cannot view posts though. getting there! thanks for the help (going to bed now will check back tomorrow)

    edit: it might not work because you used a different structure? I remember reading you used a Date structure whereas i am only using categoryname/postname (might be wrong on this its 4 am :) )

  5. Basetwo
    Member
    Posted 6 years ago #

    edit: it might not work because you used a different structure? I remember reading you used a Date structure whereas i am only using categoryname/postname (might be wrong on this its 4 am :) )

    and indeed this was the case! after using your structure ( /%year%/%monthnum%/%day%/%postname%/ ) my posts now seem to work. i guess everyone with trouble should install a 2.6.5 version and get the values from phpmyadmin haha

    post:
    http://www.signaturestop.com/2008/12/28/text-tutorial-test

  6. rutgerhensel
    Member
    Posted 6 years ago #

    I had the same problem with http://2009.nl (a fresh wp 2.7 install on apache2/php5) and it works now after just changing the first part of rewrite_rules in wp_options table...
    Changed s:12 into s:11 (as that string seems to be 11 chars long) -- I didn't check all of them ;-)

    a:63:{s:11:"robots.txt$";.......

    Same thing with another wp 2.7 blog on apache2/php4.4.4..
    But what can be the cause of this? Some host setting somewhere?

  7. rutgerhensel
    Member
    Posted 6 years ago #

    Was solved by these apache vhost settings:

    magic_quotes_runtime = Off
    magic_quotes_sybase = Off
  8. Basetwo
    Member
    Posted 6 years ago #

    sweet, where do i set those? you dont have to change the
    a:63:{s:11:"robots.txt$";.......
    part when you do this?

  9. potterhead4
    Member
    Posted 6 years ago #

    Changing from s:12 to s:11 solved the issue for me as well...posts, categories, archives and feeds are now functional with pretty permalinks. Unfortunately, on a shared host I don't have any access to apaches settings, so does anyone know if changing to s:11 is a permanent fix?

    Interesting that miscounting by one could cause a bug like that...I checked some of the other strings and they seem to be correct...didn't have time to check them all, however.

  10. smrtalex
    Member
    Posted 6 years ago #

    rutgerhensel.. Thanks!
    I though I had tried that previously, but apparently I didn't. Instead of modifying the virtual host file, I added the following lines to my .htaccess in my WordPress root installation directory:

    php_flag magic_quotes_runtime Off
    php_flag magic_quotes_sybase Off

    And it worked!!!

    Hope this helps others!!!

  11. gm10gm10
    Member
    Posted 6 years ago #

    smrtalex
    gm10gm10,
    Would it be possible to post your Linux kernel, PHP, and MySQL versions, as well as the php settings, from your new hosting account?

    Sorry for late reply.
    Appache 2.2.10
    MySQL 5.0.51a
    PHP 5.2.6 Not sure where to look for settings.

    Good luck

    gm

  12. Asharru
    Member
    Posted 6 years ago #

    I was having the same problem until a couple minutes ago. I just installed WP2.7 on an Ubuntu 8.10 server running Apache2.2.9, PHP5.2.6-2ubuntu4 w/Suhosin-Patch, mod_python3.3.1, Python2.5.2, and mysql5.0. Nothing I tried that was listed in this topic worked, so I did a site-wide search for Rewrite Rules (as I noticed that the Rewrite Rules in the database for 2.6.5 had "robots.txt" and 2.7 had "robots/.txt" and thought this may have something to do with it). Anyway, I found a post from about 6 months ago where a guy had the exact same issue on an Ubuntu server install. Turns out that it was an Apache2 error. The VirtualHost file had "AllowOverride None" for my webroot folder of /var/www/. I added a new directory listing in the VirtualHost file for the blog directory (/var/www/blog/) and added "AllowOverride All". After doing this the Permlinks work beautifully now!

    I had also wiped out 2.7 and dropped down to 2.6.5 previously to try and correct, but it still gave the 404 error and was extremely slow.

  13. Basetwo
    Member
    Posted 6 years ago #

    fixing it to a:63:{s:11:"robots.txt$";.......

    does work for a while, up until you add a new page. then you have to dive into the mysql and change it again. sucks :(

    will using

    php_flag magic_quotes_runtime Off
    php_flag magic_quotes_sybase Off

    fix it for me? i used it before, but it gave me a 505 i believe. but i hadnt changed the mysql table yet when i tried that

  14. potterhead4
    Member
    Posted 6 years ago #

    Yeah, I just noticed this as well. It's okay if you don't add too many new pages all the time, because posts don't change anything.

    I also got the 505 trying to add the php_flag stuff to my .htaccess. I'm about to e-mail my host and just link them this thread.

  15. Basetwo
    Member
    Posted 6 years ago #

    you don't happen to be using Anhosting do you? heh.

    adding the php_flag stuff gives me an internal server error, so for now im just jumping into phpmyadmin every 10 minutes to change the string while im setting up all the pages and content. a minor change to a page or order in which the pages have to be displayed will set the string back to s:12.

  16. potterhead4
    Member
    Posted 6 years ago #

    Yup, I am...that's how I found the thread. Have you submitted a ticket about it yet? If not, I mean, this is two verifiable instances of the same problem...maybe we can get some results?

    Er, I want to clarify: a ticket based on this latest information about allowoverride and php_flags, as you've already sent one in about the 404 error in general.

  17. Basetwo
    Member
    Posted 6 years ago #

    Nope I haven't, I've just been busy adding pages and writing content for my site and constantly changing the string in phpmyadmin. Perhaps there's a configuration in apache that's messing us up?

  18. potterhead4
    Member
    Posted 6 years ago #

    Well, that's what I'm thinking, so I'll send in a ticket later today. If you don't mind putting it up here, what's your domain name so I can include it in the ticket? If you'd rather do it privately, send me an email at gabe AT ghscommunications DOT com

  19. Basetwo
    Member
    Posted 6 years ago #

    so, any news?

  20. fastinos
    Member
    Posted 6 years ago #

    I am using Anhosting as well and have exactly the same problem. I dont know what to do i have searched everywhere and done everything.

  21. ezaykiel
    Member
    Posted 6 years ago #

    I was finally able to get my blog working by using this:

    php_flag magic_quotes_gpc Off

    Overall it looks like this

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

    Hopefully this will work for some of you. It worked for me finally!

  22. potterhead4
    Member
    Posted 6 years ago #

    I submitted a ticket and they wrote back saying they could not produce the error on their end. Sure enough, when I tried going back and doing it on any of my existing blogs or a clean install, I was unable to reproduce the error. All pretty permalinks are now working across my account. So something changed, I'm not sure.

    However, WordPress loads are still pretty slow, especially in peak times - this is with SuperCache installed and activated. I may submit a ticket to them about that fairly soon.

  23. fastinos
    Member
    Posted 6 years ago #

    Still Nothing from me. I dont know what else to do.

  24. fastinos
    Member
    Posted 6 years ago #

    Hello,

    We have tried to change the "Permalink Settings" as per your request.
    When we change the settings, it is taking effect also. The new redirection
    values are written to .htaccess file. But there is no data in that redirected
    place currently. Could you pleas check with the WordPress support regarding
    this matter.

    Currently we have reverted back the changes to default.

    ***********************
    root@ans70 [/home/qualgia4/public_html]# cat .htaccess
    # BEGIN WordPress
    RewriteEngine On
    RewriteBase /
    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteCond %{REQUEST_FILENAME} !-d
    RewriteRule . /index.php [L]

    # END WordPress
    root@ans70 [/home/qualgia4/public_html]# find . -name "2009"
    root@ans70 [/home/qualgia4/public_html]#
    **********************************

    In case you have any more queries, please don't hesitate to contact us with
    all the required details. We'll be happy to assist you further.

    --
    Regards,
    Thomas M
    Technical Support Representative.
    Hosting Services Inc

  25. filination
    Member
    Posted 6 years ago #

    Helping out a friend with this issue on shared hosting (Anhosting) this is the solution we arrived at :

    I tried one more thing. It seems Anhosting allows changing some PHP variables by adding a PHP.INI file to the directory in question (http://help.midphase.com/support/questions.php?questionid=527) so I added a PHP.INI file with the following directive :
    magic_quotes_gpc = Off

    I created a new entry, and it was posted okay, so I’m guessing this problem is now solved. Let me know if you realize otherwise.

  26. potterhead4
    Member
    Posted 6 years ago #

    Yup, that seems to have done the trick for me. As I mentioned, I was no longer experiencing permalink issues, but the install was extremely slow, which was a symptom others had mentioned. Adding the php.ini file seems to have dramatically sped up the load times of the installation.

  27. Basetwo
    Member
    Posted 6 years ago #

    I'm hosted at anhosting, and it seems that the problem has magically dissapeared. i can now edit pages without getting 404s. not sure if i can still edit pages, but since i've launched my site im not going to mess around with it anymore.

  28. antiresearch
    Member
    Posted 6 years ago #

    Yep! I'm also with AN Hosting and the problem has magically disappeared for me too. Basetwo: I also edited my "About page" with no problems.

  29. darthpooky
    Member
    Posted 6 years ago #

    I tried all of the solutions posted here and none of them worked. What finally fixed it was two things. Please keep in mind that this is with a self-installed Ubuntu 8.10 server running LAMP

    1. Having AllowOveride set to all in my virtual host config
    2. And running the following command sudo a2enmod rewrite

    That command was found Here

  30. noogrub
    Member
    Posted 6 years ago #

    We host our WordPress installation using Redhat linux and apache. Our host is a virtual host.

    In order to get Permalinks to behave properly, we have to add:
    RewriteOptions Inherit

    to our .htaccess file, in addition to the items which WordPress wrote. We also made sure that
    RewriteEngine On
    was there.

    Documentation for mod_rewrite mentions the need for the "Inherit" option, which is NOT set by default:
    http://httpd.apache.org/docs/2.2/mod/mod_rewrite.html

    Note that if you wish, you can add
    RewriteEngine On
    RewriteOptions Inherit
    inside the virtual host block in your httpd.conf

    Hope that helps someone!
    John

Topic Closed

This topic has been closed to new replies.

About this Topic