1

First of all, I am very new to wordpress and know almost nothing about it.

When I create the page foo using in wp-admin, I get the message that the page is created. When I click on view page, it 404s. I've followed the steps on http://codex.wordpress.org/Pages#Creating_Pages, but apparently I'm missing something.

I let Wordpress rebuild my .htaccess, but still no luck.

System specifications:

  • Ubuntu 13.04
  • Apache2
  • PHP 5.4.9
  • MySQL 14.14 Distrib 5.5.32

Installed Wordpress Plugins:

  • Debug This
  • My own (empty) plugin

.htaccess

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

# END WordPress

"Debug This" output for query -> rewrite

Current Rewrite

Matched Rule: 
Matched Query: 
Query String: debug-this=rewrites

Rewrite Rules

Rule    Rewrite
dating_user/?$  index.php?post_type=dating_user
dating_user/feed/(feed|rdf|rss|rss2|atom)/?$    index.php?post_type=dating_user&feed=$matches[1]
dating_user/(feed|rdf|rss|rss2|atom)/?$ index.php?post_type=dating_user&feed=$matches[1]
dating_user/page/([0-9]{1,})/?$ index.php?post_type=dating_user&paged=$matches[1]
category/(.+?)/feed/(feed|rdf|rss|rss2|atom)/?$ index.php?category_name=$matches[1]&feed=$matches[2]
category/(.+?)/(feed|rdf|rss|rss2|atom)/?$  index.php?category_name=$matches[1]&feed=$matches[2]
category/(.+?)/page/?([0-9]{1,})/?$ index.php?category_name=$matches[1]&paged=$matches[2]
category/(.+?)/?$   index.php?category_name=$matches[1]
tag/([^/]+)/feed/(feed|rdf|rss|rss2|atom)/?$    index.php?tag=$matches[1]&feed=$matches[2]
tag/([^/]+)/(feed|rdf|rss|rss2|atom)/?$ index.php?tag=$matches[1]&feed=$matches[2]
tag/([^/]+)/page/?([0-9]{1,})/?$    index.php?tag=$matches[1]&paged=$matches[2]
tag/([^/]+)/?$  index.php?tag=$matches[1]
type/([^/]+)/feed/(feed|rdf|rss|rss2|atom)/?$   index.php?post_format=$matches[1]&feed=$matches[2]
type/([^/]+)/(feed|rdf|rss|rss2|atom)/?$    index.php?post_format=$matches[1]&feed=$matches[2]
type/([^/]+)/page/?([0-9]{1,})/?$   index.php?post_format=$matches[1]&paged=$matches[2]
type/([^/]+)/?$ index.php?post_format=$matches[1]
dating_user/[^/]+/attachment/([^/]+)/?$ index.php?attachment=$matches[1]
dating_user/[^/]+/attachment/([^/]+)/trackback/?$   index.php?attachment=$matches[1]&tb=1
dating_user/[^/]+/attachment/([^/]+)/feed/(feed|rdf|rss|rss2|atom)/?$   index.php?attachment=$matches[1]&feed=$matches[2]
dating_user/[^/]+/attachment/([^/]+)/(feed|rdf|rss|rss2|atom)/?$    index.php?attachment=$matches[1]&feed=$matches[2]
dating_user/[^/]+/attachment/([^/]+)/comment-page-([0-9]{1,})/?$    index.php?attachment=$matches[1]&cpage=$matches[2]
dating_user/([^/]+)/trackback/?$    index.php?dating_user=$matches[1]&tb=1
dating_user/([^/]+)/feed/(feed|rdf|rss|rss2|atom)/?$    index.php?dating_user=$matches[1]&feed=$matches[2]
dating_user/([^/]+)/(feed|rdf|rss|rss2|atom)/?$ index.php?dating_user=$matches[1]&feed=$matches[2]
dating_user/([^/]+)/page/?([0-9]{1,})/?$    index.php?dating_user=$matches[1]&paged=$matches[2]
dating_user/([^/]+)/comment-page-([0-9]{1,})/?$ index.php?dating_user=$matches[1]&cpage=$matches[2]
dating_user/([^/]+)(/[0-9]+)?/?$    index.php?dating_user=$matches[1]&page=$matches[2]
dating_user/[^/]+/([^/]+)/?$    index.php?attachment=$matches[1]
dating_user/[^/]+/([^/]+)/trackback/?$  index.php?attachment=$matches[1]&tb=1
dating_user/[^/]+/([^/]+)/feed/(feed|rdf|rss|rss2|atom)/?$  index.php?attachment=$matches[1]&feed=$matches[2]
dating_user/[^/]+/([^/]+)/(feed|rdf|rss|rss2|atom)/?$   index.php?attachment=$matches[1]&feed=$matches[2]
dating_user/[^/]+/([^/]+)/comment-page-([0-9]{1,})/?$   index.php?attachment=$matches[1]&cpage=$matches[2]
gn-genre/([^/]+)/feed/(feed|rdf|rss|rss2|atom)/?$   index.php?taxonomy=gn-genre&term=$matches[1]&feed=$matches[2]
gn-genre/([^/]+)/(feed|rdf|rss|rss2|atom)/?$    index.php?taxonomy=gn-genre&term=$matches[1]&feed=$matches[2]
gn-genre/([^/]+)/page/?([0-9]{1,})/?$   index.php?taxonomy=gn-genre&term=$matches[1]&paged=$matches[2]
gn-genre/([^/]+)/?$ index.php?taxonomy=gn-genre&term=$matches[1]
gn-location-3/([^/]+)/feed/(feed|rdf|rss|rss2|atom)/?$  index.php?taxonomy=gn-location-3&term=$matches[1]&feed=$matches[2]
gn-location-3/([^/]+)/(feed|rdf|rss|rss2|atom)/?$   index.php?taxonomy=gn-location-3&term=$matches[1]&feed=$matches[2]
gn-location-3/([^/]+)/page/?([0-9]{1,})/?$  index.php?taxonomy=gn-location-3&term=$matches[1]&paged=$matches[2]
gn-location-3/([^/]+)/?$    index.php?taxonomy=gn-location-3&term=$matches[1]
gn-location-2/([^/]+)/feed/(feed|rdf|rss|rss2|atom)/?$  index.php?taxonomy=gn-location-2&term=$matches[1]&feed=$matches[2]
gn-location-2/([^/]+)/(feed|rdf|rss|rss2|atom)/?$   index.php?taxonomy=gn-location-2&term=$matches[1]&feed=$matches[2]
gn-location-2/([^/]+)/page/?([0-9]{1,})/?$  index.php?taxonomy=gn-location-2&term=$matches[1]&paged=$matches[2]
gn-location-2/([^/]+)/?$    index.php?taxonomy=gn-location-2&term=$matches[1]
gn-location-1/([^/]+)/feed/(feed|rdf|rss|rss2|atom)/?$  index.php?taxonomy=gn-location-1&term=$matches[1]&feed=$matches[2]
gn-location-1/([^/]+)/(feed|rdf|rss|rss2|atom)/?$   index.php?taxonomy=gn-location-1&term=$matches[1]&feed=$matches[2]
gn-location-1/([^/]+)/page/?([0-9]{1,})/?$  index.php?taxonomy=gn-location-1&term=$matches[1]&paged=$matches[2]
gn-location-1/([^/]+)/?$    index.php?taxonomy=gn-location-1&term=$matches[1]
robots\.txt$    index.php?robots=1
.*wp-(atom|rdf|rss|rss2|feed|commentsrss2)\.php$    index.php?feed=old
.*wp-app\.php(/.*)?$    index.php?error=403
.*wp-register.php$  index.php?register=true
feed/(feed|rdf|rss|rss2|atom)/?$    index.php?&feed=$matches[1]
(feed|rdf|rss|rss2|atom)/?$ index.php?&feed=$matches[1]
page/?([0-9]{1,})/?$    index.php?&paged=$matches[1]
comments/feed/(feed|rdf|rss|rss2|atom)/?$   index.php?&feed=$matches[1]&withcomments=1
comments/(feed|rdf|rss|rss2|atom)/?$    index.php?&feed=$matches[1]&withcomments=1
search/(.+)/feed/(feed|rdf|rss|rss2|atom)/?$    index.php?s=$matches[1]&feed=$matches[2]
search/(.+)/(feed|rdf|rss|rss2|atom)/?$ index.php?s=$matches[1]&feed=$matches[2]
search/(.+)/page/?([0-9]{1,})/?$    index.php?s=$matches[1]&paged=$matches[2]
search/(.+)/?$  index.php?s=$matches[1]
author/([^/]+)/feed/(feed|rdf|rss|rss2|atom)/?$ index.php?author_name=$matches[1]&feed=$matches[2]
author/([^/]+)/(feed|rdf|rss|rss2|atom)/?$  index.php?author_name=$matches[1]&feed=$matches[2]
author/([^/]+)/page/?([0-9]{1,})/?$ index.php?author_name=$matches[1]&paged=$matches[2]
author/([^/]+)/?$   index.php?author_name=$matches[1]
([0-9]{4})/([0-9]{1,2})/([0-9]{1,2})/feed/(feed|rdf|rss|rss2|atom)/?$   index.php?year=$matches[1]&monthnum=$matches[2]&day=$matches[3]&feed=$matches[4]
([0-9]{4})/([0-9]{1,2})/([0-9]{1,2})/(feed|rdf|rss|rss2|atom)/?$    index.php?year=$matches[1]&monthnum=$matches[2]&day=$matches[3]&feed=$matches[4]
([0-9]{4})/([0-9]{1,2})/([0-9]{1,2})/page/?([0-9]{1,})/?$   index.php?year=$matches[1]&monthnum=$matches[2]&day=$matches[3]&paged=$matches[4]
([0-9]{4})/([0-9]{1,2})/([0-9]{1,2})/?$ index.php?year=$matches[1]&monthnum=$matches[2]&day=$matches[3]
([0-9]{4})/([0-9]{1,2})/feed/(feed|rdf|rss|rss2|atom)/?$    index.php?year=$matches[1]&monthnum=$matches[2]&feed=$matches[3]
([0-9]{4})/([0-9]{1,2})/(feed|rdf|rss|rss2|atom)/?$ index.php?year=$matches[1]&monthnum=$matches[2]&feed=$matches[3]
([0-9]{4})/([0-9]{1,2})/page/?([0-9]{1,})/?$    index.php?year=$matches[1]&monthnum=$matches[2]&paged=$matches[3]
([0-9]{4})/([0-9]{1,2})/?$  index.php?year=$matches[1]&monthnum=$matches[2]
([0-9]{4})/feed/(feed|rdf|rss|rss2|atom)/?$ index.php?year=$matches[1]&feed=$matches[2]
([0-9]{4})/(feed|rdf|rss|rss2|atom)/?$  index.php?year=$matches[1]&feed=$matches[2]
([0-9]{4})/page/?([0-9]{1,})/?$ index.php?year=$matches[1]&paged=$matches[2]
([0-9]{4})/?$   index.php?year=$matches[1]
[0-9]{4}/[0-9]{1,2}/[0-9]{1,2}/[^/]+/attachment/([^/]+)/?$  index.php?attachment=$matches[1]
[0-9]{4}/[0-9]{1,2}/[0-9]{1,2}/[^/]+/attachment/([^/]+)/trackback/?$    index.php?attachment=$matches[1]&tb=1
[0-9]{4}/[0-9]{1,2}/[0-9]{1,2}/[^/]+/attachment/([^/]+)/feed/(feed|rdf|rss|rss2|atom)/?$    index.php?attachment=$matches[1]&feed=$matches[2]
[0-9]{4}/[0-9]{1,2}/[0-9]{1,2}/[^/]+/attachment/([^/]+)/(feed|rdf|rss|rss2|atom)/?$ index.php?attachment=$matches[1]&feed=$matches[2]
[0-9]{4}/[0-9]{1,2}/[0-9]{1,2}/[^/]+/attachment/([^/]+)/comment-page-([0-9]{1,})/?$ index.php?attachment=$matches[1]&cpage=$matches[2]
([0-9]{4})/([0-9]{1,2})/([0-9]{1,2})/([^/]+)/trackback/?$   index.php?year=$matches[1]&monthnum=$matches[2]&day=$matches[3]&name=$matches[4]&tb=1
([0-9]{4})/([0-9]{1,2})/([0-9]{1,2})/([^/]+)/feed/(feed|rdf|rss|rss2|atom)/?$   index.php?year=$matches[1]&monthnum=$matches[2]&day=$matches[3]&name=$matches[4]&feed=$matches[5]
([0-9]{4})/([0-9]{1,2})/([0-9]{1,2})/([^/]+)/(feed|rdf|rss|rss2|atom)/?$    index.php?year=$matches[1]&monthnum=$matches[2]&day=$matches[3]&name=$matches[4]&feed=$matches[5]
([0-9]{4})/([0-9]{1,2})/([0-9]{1,2})/([^/]+)/page/?([0-9]{1,})/?$   index.php?year=$matches[1]&monthnum=$matches[2]&day=$matches[3]&name=$matches[4]&paged=$matches[5]
([0-9]{4})/([0-9]{1,2})/([0-9]{1,2})/([^/]+)/comment-page-([0-9]{1,})/?$    index.php?year=$matches[1]&monthnum=$matches[2]&day=$matches[3]&name=$matches[4]&cpage=$matches[5]
([0-9]{4})/([0-9]{1,2})/([0-9]{1,2})/([^/]+)(/[0-9]+)?/?$   index.php?year=$matches[1]&monthnum=$matches[2]&day=$matches[3]&name=$matches[4]&page=$matches[5]
[0-9]{4}/[0-9]{1,2}/[0-9]{1,2}/[^/]+/([^/]+)/?$ index.php?attachment=$matches[1]
[0-9]{4}/[0-9]{1,2}/[0-9]{1,2}/[^/]+/([^/]+)/trackback/?$   index.php?attachment=$matches[1]&tb=1
[0-9]{4}/[0-9]{1,2}/[0-9]{1,2}/[^/]+/([^/]+)/feed/(feed|rdf|rss|rss2|atom)/?$   index.php?attachment=$matches[1]&feed=$matches[2]
[0-9]{4}/[0-9]{1,2}/[0-9]{1,2}/[^/]+/([^/]+)/(feed|rdf|rss|rss2|atom)/?$    index.php?attachment=$matches[1]&feed=$matches[2]
[0-9]{4}/[0-9]{1,2}/[0-9]{1,2}/[^/]+/([^/]+)/comment-page-([0-9]{1,})/?$    index.php?attachment=$matches[1]&cpage=$matches[2]
([0-9]{4})/([0-9]{1,2})/([0-9]{1,2})/comment-page-([0-9]{1,})/?$    index.php?year=$matches[1]&monthnum=$matches[2]&day=$matches[3]&cpage=$matches[4]
([0-9]{4})/([0-9]{1,2})/comment-page-([0-9]{1,})/?$ index.php?year=$matches[1]&monthnum=$matches[2]&cpage=$matches[3]
([0-9]{4})/comment-page-([0-9]{1,})/?$  index.php?year=$matches[1]&cpage=$matches[2]
.?.+?/attachment/([^/]+)/?$ index.php?attachment=$matches[1]
.?.+?/attachment/([^/]+)/trackback/?$   index.php?attachment=$matches[1]&tb=1
.?.+?/attachment/([^/]+)/feed/(feed|rdf|rss|rss2|atom)/?$   index.php?attachment=$matches[1]&feed=$matches[2]
.?.+?/attachment/([^/]+)/(feed|rdf|rss|rss2|atom)/?$    index.php?attachment=$matches[1]&feed=$matches[2]
.?.+?/attachment/([^/]+)/comment-page-([0-9]{1,})/?$    index.php?attachment=$matches[1]&cpage=$matches[2]
(.?.+?)/trackback/?$    index.php?pagename=$matches[1]&tb=1
(.?.+?)/feed/(feed|rdf|rss|rss2|atom)/?$    index.php?pagename=$matches[1]&feed=$matches[2]
(.?.+?)/(feed|rdf|rss|rss2|atom)/?$ index.php?pagename=$matches[1]&feed=$matches[2]
(.?.+?)/page/?([0-9]{1,})/?$    index.php?pagename=$matches[1]&paged=$matches[2]
(.?.+?)/comment-page-([0-9]{1,})/?$ index.php?pagename=$matches[1]&cpage=$matches[2]
(.?.+?)(/[0-9]+)?/?$    index.php?pagename=$matches[1]&page=$matches[2]

I also verified that Apache's mod_rewrite module is installed and enabled.

apache2.conf (comments removed):

LockFile ${APACHE_LOCK_DIR}/accept.lock

PidFile ${APACHE_PID_FILE}

Timeout 300

KeepAlive On

MaxKeepAliveRequests 100

KeepAliveTimeout 5

<IfModule mpm_prefork_module>
    StartServers          5
    MinSpareServers       5
    MaxSpareServers      10
    MaxClients          150
    MaxRequestsPerChild   0
</IfModule>

<IfModule mpm_worker_module>
    StartServers          2
    MinSpareThreads      25
    MaxSpareThreads      75 
    ThreadLimit          64
    ThreadsPerChild      25
    MaxClients          150
    MaxRequestsPerChild   0
</IfModule>

<IfModule mpm_event_module>
    StartServers          2
    MinSpareThreads      25
    MaxSpareThreads      75 
    ThreadLimit          64
    ThreadsPerChild      25
    MaxClients          150
    MaxRequestsPerChild   0
</IfModule>

User ${APACHE_RUN_USER}
Group ${APACHE_RUN_GROUP}

AccessFileName .htaccess

<Files ~ "^\.ht">
    Order allow,deny
    Deny from all
    Satisfy all
</Files>

DefaultType None


HostnameLookups Off

ErrorLog ${APACHE_LOG_DIR}/error.log

LogLevel warn

Include mods-enabled/*.load
Include mods-enabled/*.conf

Include ports.conf

LogFormat "%v:%p %h %l %u %t \"%r\" %>s %O \"%{Referer}i\" \"%{User-Agent}i\"" vhost_combined
LogFormat "%h %l %u %t \"%r\" %>s %O \"%{Referer}i\" \"%{User-Agent}i\"" combined
LogFormat "%h %l %u %t \"%r\" %>s %O" common
LogFormat "%{Referer}i -> %U" referer
LogFormat "%{User-agent}i" agent

Include conf.d/

Include sites-enabled/

Include /etc/phpmyadmin/apache.conf
4
  • 1
    does your server have mod_rewrite?
    – Milo
    Commented Sep 29, 2013 at 14:35
  • @Milo Yep, I just verified.
    – Joren
    Commented Sep 30, 2013 at 7:53
  • Do other URLs work, like posts? Categories? Tags? Is the page slug literally "foo" or is it something else? Commented Sep 30, 2013 at 13:24
  • just change the permalink to defoult and check the page after that make the permalink same as per requirment also check the mod_rewrites is active on server or not it amy also effect for this Commented Oct 1, 2013 at 5:06

6 Answers 6

2
+100

Like Manish, I think the issue is with AllowOverride.

The following is based on a Debian server. Ubuntu, if you are not aware, is based on Debian.

In your apache2/ directory, you should have a sites-available/ and a sites-enabled/ directory.

  1. Disable your site with a2dissite
  2. Edit the appropriate file in sites-available/ to include the AllowOverride directive.
  3. Enable the site with a2ensite.

The following is based on y entry for my sandbox install of the current WordPress on my dev server:

# Apache configuration

Alias /wp_release /path/to/site/files

<Directory /path/to/site/files>
    AllowOverride FileInfo
    DirectoryIndex index.php
    Allow from All
    <IfModule mod_php5.c>
        AddType application/x-httpd-php .php

        php_flag magic_quotes_gpc Off
        php_flag track_vars On
        php_flag register_globals Off
        php_value include_path .
    </IfModule>

</Directory>

That is from a dev site with no access to the public internet (and I may have twitched something as an experiment at some point along the way). You may not want exactly that on a production server but the key parts are these bits:

    AllowOverride FileInfo
    DirectoryIndex index.php

Reference: http://httpd.apache.org/docs/current/mod/core.html#allowoverride

1

There are few things you can do about it ..

1) You can reset the permalink array by going to the permalinks tab in wp-admin and simply re-saving the permalink structure.

Navigate to: WordPress Dashboard → Settings → Permalinks: Click “Save Changes”.

2)Next, use a debugger to view the rewrite array and confirm that the rewrite rule responsible for processing your URL is not in place. To do this, install the plugin Debug This, which makes it easy to view what is actually in the WordPress rewrite array.

Once this plugin is installed and activated, go to your site. Then navigate to:

Homepage → Admin Bar → Debug ThisQuery → Rewrites.

Try this things and let us know what error it gives..

Also 3rd thing I found that conflicting settings in some SEO plugins created the missing pages problem.

As your using SEO plugin ..I suggest just deactivate it and check ..

And as SEO Plugin alternate you can use All In One SEO. It works great, unless the configuration are wrong .

1
  • Thank you for your answer, I've deactivated all plugins; still the same issue. Also I've updated my answer with the output of Debug This rewrites.
    – Joren
    Commented Sep 30, 2013 at 8:08
0

Wordpress categorizes posts not pages.

In any case you are doing things the wrong way round. If you want to create categories go to:

Appearance > Posts > Categories

and set them up there. Or use the category manager on the RH side of the Post editor.

1
  • I've already got my categories set up and successfully managed to display them on the homepage. I'm looking for a way to display a page when a user clicks on a category.
    – Joren
    Commented Sep 19, 2013 at 14:35
0

First step is to simplify. Disable all the plugins and set your theme back to a default built-in like Twenty Thirteen. Report back with what happens.

If creating and viewing a page starts working again you know it is a plugin or theme issue. Activate one-at-a-time until you discover which one is breaking functionality.

If the basic WordPress install and default theme are still not working you have a server configuration or domain/host name configuration issue. Make sure the URL for View Pages is correct and matches what you expect. If not check your general settings in WordPress.

0
  1. Delete .htaccess file
  2. Go To Setting > Permalinks
  3. Change your Permalinks type to anything else than current one
  4. Save Changes

That will create new .htaccess, hopefully it will be formatted the way WordPress loves!

1
  • @Joren so did it fixed your issue?
    – Nizam Kazi
    Commented Oct 3, 2013 at 9:47
0

What I understand from the above is you have .htaccess file and also correct code written in to the same file but still getting 404 issue. Let me tell you why. Your server not allowing .htaccess file to read or override permission. So how can you give this permission? Open your Apache httpd.conf file serch for AllowOverride now you can see it is present several times. check for below comment in to the same file:

 # AllowOverride controls what directives may be placed in .htaccess files.
    # It can be "All", "None", or any combination of the keywords:
    #   Options FileInfo AuthConfig Limit
    #
    AllowOverride None

Just replace AllowOverride None by AllowOverride All

Now restart APACHE and it should work

2
  • There is no AllowOverride in my apache2.conf (I don't have a httpd.conf since I'm using Ubuntu 13.04). If I insert it anyway, the apache2 service won't start. I've updated my question with additional information about my apache2.conf
    – Joren
    Commented Oct 3, 2013 at 11:09
  • s_ha_dum already answered it correctly. I was not aware about your system config that time. I am using WINDOWS 7 so given answer as per that.
    – Manish
    Commented Oct 3, 2013 at 19:49

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.