You are not logged in.

#1 2013-01-23 00:41:42

ill
Member
From: US
Registered: 2011-06-22
Posts: 115

[SOLVED] Apache + WordPress + mod_rewrite

Hey, I'm working on migrating a wordpress site from one server to another and I have it mostly working, the home page loads fine but when I try to browse to other pages (eg: example.com/info-page/) I get a 404 error from the web server even though mod_rewrite is enabled and I have the following .htaccess in the wordpress directory:

# 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 can provide other config info if needed, just let me know. This has had me confused for a couple hours now and my brain is just ready to give up.

Last edited by ill (2013-01-24 03:03:25)

Offline

#2 2013-01-23 01:34:12

drcouzelis
Member
From: Connecticut, USA
Registered: 2009-11-09
Posts: 3,441
Website

Re: [SOLVED] Apache + WordPress + mod_rewrite

On my personal Arch Linux server I use Apache, I use WordPress, and I use mod_rewrite, and I'd be happy to share my configuration with you, but please bare in mind I have no idea how they work or what they mean. tongue

.htaccess:

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

# END WordPress

I thought I also added something in my Apache settings, but I don't have access to my server at the moment. sad

EDIT: I found it. In "/etc/httpd/conf/httpd.conf":

LoadModule rewrite_module modules/mod_rewrite.so

Last edited by drcouzelis (2013-01-23 01:42:19)

Offline

#3 2013-01-23 02:12:10

ill
Member
From: US
Registered: 2011-06-22
Posts: 115

Re: [SOLVED] Apache + WordPress + mod_rewrite

Appreciate the post, but that's exactly the same .htaccess I have and I have made sure mod_rewrite is enabled in the apache config.

Offline

#4 2013-01-23 02:27:15

drcouzelis
Member
From: Connecticut, USA
Registered: 2009-11-09
Posts: 3,441
Website

Re: [SOLVED] Apache + WordPress + mod_rewrite

ill wrote:

that's exactly the same .htaccess I have

No it isn't... RewriteBase and RewriteRule are different. I thought those were the important parts... hmm

Offline

#5 2013-01-23 04:32:35

ill
Member
From: US
Registered: 2011-06-22
Posts: 115

Re: [SOLVED] Apache + WordPress + mod_rewrite

Your wordpress install is in /wordpress/, mine is in the root directory (/). Exact same config.

Edit: Apache config "AllowOverride None" -> "AllowOverride All" fixed it.

Last edited by ill (2013-01-24 03:03:52)

Offline

#6 2013-07-22 13:33:26

f1tzl4nd
Member
From: Corsicana, TX ~ US
Registered: 2012-07-26
Posts: 4

Re: [SOLVED] Apache + WordPress + mod_rewrite

This post also helped me, but I thought a little more detail might help others.

Within <Directory> section of the /etc/httpd/conf/httpd.conf file found "AllowOverride None". Changed this to "AllowOverride All", but it didn't help.

Problem was virtual hosts. So instead, went to the <Directory> section within the /etc/httpd/conf/extra/httpd-vhosts.conf file and made change there.

Probably obvious to most, but took me a little extra time to figure out.

Offline

Board footer

Powered by FluxBB