.htaccess mod_rewrite for Wordpress ... gives me a 403

I'm trying to turn on the mod_rewrite options that Wordpress wants.

I have a .htaccess file for use during development that looks like this:
# ALLOW USER BY IP
<Limit GET POST>
 order deny,allow
 deny from all
 allow from 1.2.3.4
 allow from 4.3.2.1
</Limit>

Open in new window


That is to permit only the developers to access the site for the moment.  And it works.

But if I append this block that Wordpress recommends, I get a 403.
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /
RewriteRule ^index\.php$ - [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /index.php [L]
</IfModule>

Open in new window


In my .conf file I have
AllowOverride all

Open in new window

in the Directory area.  When I had
AllowOverride FileInfo

Open in new window

I got error 500.

Any ideas what's wrong?  I'm running Apache 2.4.7 on Ubuntu 14.04 LTS.

Thanks
LVL 32
Daniel WilsonAsked:
Who is Participating?

[Product update] Infrastructure Analysis Tool is now available with Business Accounts.Learn More

x
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

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

# END WordPress

Open in new window

-saige-
Daniel WilsonAuthor Commented:
Thanks, Saige, but that's what gives me 403 errors.
it_saigeDeveloperCommented:
I was drawn to this line (I will admit, I am hardly a WordPress guru):
RewriteRule . /index.php [L]

Open in new window

This line in my htaccess file is different (And, admittedly, may have no affect at all)

-saige-
Acronis True Image 2019 just released!

Create a reliable backup. Make sure you always have dependable copies of your data so you can restore your entire system or individual files.

Daniel WilsonAuthor Commented:
Unfortunately adding the [L] didn't solve it.

Other ideas?
DzynitCommented:
Do you have the wordpress code before the access code?
And you've also set your permalinks in the wp-admin right?
Daniel WilsonAuthor Commented:
We turned the permalinks back off in wp-admin.  But at the base page -- mysite/ -- we get a 403.

I'm testing without the access code now.  Just the WordPress code.

If I comment out everything inside the <IfModule> section, I don't get an error. But if I turn
RewriteEngine On

Open in new window

, I get the error again, even with no Rewrite rules or conditions.
it_saigeDeveloperCommented:
Try 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
</IfModule>

# END WordPress

# ALLOW USER BY IP
<Limit GET POST>
 order deny,allow
 deny from all
 allow from 1.2.3.4
 allow from 4.3.2.1
</Limit>

Open in new window


-saige-

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
it_saigeDeveloperCommented:
Just saw your latest post.  So just using the RewriteEngine On without any rules produces the error?

-saige-
it_saigeDeveloperCommented:
What do your apache error and access logs show

/var/log/apache2/error_log and /var/log/apache2/access_log

-saige-
Daniel WilsonAuthor Commented:
Options +FollowSymLinks

at the top is getting it to be accepted.
Daniel WilsonAuthor Commented:
I needed the Options line.  After that, it_saige's ideas worked.
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Apache Web Server

From novice to tech pro — start learning today.