views:

29

answers:

2

I made a custom page template (for example, for About page), added Template Name inside the file and saved that. Then I tried to add a page in wp admin console using that template. It said that the page had been created successfully but when I try to open it in browser, it shows me 404 error. What did I do wrong? Thanks.

I forgot to say that I set up permalinks to be /%postname%/ and then it give me that error. If I use no permalinks (default setting), it show the page normally.

A: 

I think the problem is nothing to do with your custom template, but your permalink structure.

It's not really recommended to just use /%postname%/ - quoting from the Codex;

Starting Permalinks with %postname% is strongly not recommended for performance reasons..

What's the slug (the 'sanitized' title used in the URL) of the problem page?

TheDeadMedic
it's just 'about' string. I tried to find something on the problem and it seems like there is something with Apache mod_rewrite. I use local wamp so may be I should set some settings although I already turned on the setting in apache conf file to load mod_rewrite module.
Sergey Basharov
A: 

Make sure you've rebooted Apache after editing the config file.

Also check there is a .htaccess file (no filename, with an extension 'htaccess') in your WordPress root, and that it contains;

# 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
TheDeadMedic
I have checked it all and the .htaccess file is the same. May be I can do anything else about this? The other way is I can upload it to a hosting provider and test it there. Thanks.
Sergey Basharov
To double double check you really have got mod_rewrite loaded, take out the `<IfModule />` lines. Apache should throw a wobbly if mod_rewrite isn't loaded.
TheDeadMedic
Yep, it just didn't start. Does it mean that the mod_rewrite was not loaded?I have this uncommented string in httpd.conf file:LoadModule rewrite_module modules/mod_rewrite.sois that enough to load this module?
Sergey Basharov
Which version of Apache are you running? I think some also need the line `ClearModuleList` uncommented, as well as `AddModule mod_rewrite.c`. Plus you definitely restarted Apache?
TheDeadMedic