Phil
(@owendevelopment)
URL rewrites enabled for Apache? Like mod_rewrite?
* I have configured Apache (httpd.conf to allow “mod_rewrite”)*
Phil
(@owendevelopment)
OK. Hmm.
Not to state the obvious, but did you check permissions on your htaccess file? ie, does WordPress have the permission to alter the permalink structure in the htaccess?
Also, when you change to /%category%/%postname%/, does the htaccess look (similar) like this?
# 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
I’m having a similar experience on several internal local test sites. My permalink requests for settings other than default return 404 Errors. I can see that settings changes in the permalinks page results in mod_rewrite changes to the .htaccess file. Only the Default setting returns the pages.
My sites are running on CentOS Apache. Below is the way the mod_rewrite is added to my site in MAMP.
# 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
It looks to me like I have full permissions in Windows 7 which I gather is equivalent to 777 in Unix. I’m not clear on this and I don’t know how to set the permissions on local Apache. I know how to do it in the Apache server on my web host via my FTP client. So the answer is – I’m not sure except Windows 7 says I have full control of the file. Here is the .htaccess file:
# BEGIN WordPress
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /bigsurwebdesign/
RewriteRule ^index\.php$ – [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /bigsurwebdesign/index.php [L]
</IfModule>
# END WordPress
I’ll hold off to see is @sonofadoc finds a solution.
Phil
(@owendevelopment)
OK.
Can you double-check inside another file: Apache > Conf
Locate the file httpd.conf. Open that in a text editor.
Find “rewrite”. The line you need looks like this:
#LoadModule rewrite_module modules/mod_rewrite.so
You sometimes need to take away the hash sign so it looks like this
LoadModule rewrite_module modules/mod_rewrite.so
Save and test if it makes any difference.
I have done this Phil. That falls under the category of:
* I have configured Apache (httpd.conf to allow “mod_rewrite”)*
which means I have removed the hash tag.
Phil
(@owendevelopment)
Hmm. OK. Check that AllowOverride is set to All:
AllowOverride All
I’ve go to run Phil. I’ll have to get back to this. Thanks for your help. I’ll be back.
sonofadoc
Here are the default setting I found and the 2 instances of “AllowOveride” in the httpd.conf file for AllowOverride. Wherever it says ,AllowOverride None’ I replaced none with ‘All’. I still get the 404 error.
# 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
<Directory "C:/Apache/cgi-bin">
AllowOverride None
Options None
Order allow,deny
Allow from all
</Directory>
#
# Controls who can get stuff from this server.
#
Order allow,deny
Allow from all
Here’s the changed code in the httpd.conf file:
ServerRoot "C:/Apache"
DocumentRoot "C:/webpages"
<Directory />
Options FollowSymLinks
AllowOverride All
Order deny,allow
Deny from all
</Directory>
# 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 All
#
# Controls who can get stuff from this server.
#
Order allow,deny
Allow from all
</Directory>
Something I’m just now realizing which I don’t think is right on taking another look at the .htaccess file on my local server and comparing it to the one in my public_html folder on my host server. Here’s the file on my host server where the custom permalinks work:
# 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
and here’s the one on my local server where I get the 404 error:
# BEGIN WordPress
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /bigsurwebdesign/
RewriteRule ^index\.php$ - [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /bigsurwebdesign/index.php [L]
</IfModule>
# END WordPress
I don’t know how the .htaccess file really works so it’s difficult to wrap my head around it, but this .htaccess file is located in a directory called “bigsurwebdesign” along with the wordpress directory. So, it seems to me these paths to bigsurwebdesign directories are wrong.
On that note here’s a question I’ve wondered about for some time. Is . / the same as ../ or up one directory?
I copied and pasted my .htaccess file on my host server replacing the one on my local server to see what would happen. Nothing changed and nothing broke. Exactly what do these .htaccess files do? Same 404 error unless I change the permalinks to the default.