Register Advertise with usHelp Desk Today's Posts Search

Closed Thread
Thread Tools Search this Thread
Unread 27th Feb 2015, 03:19 AM   #1
HyperActive Warrior
War Room Member
 
Join Date: 2011
Posts: 190
Thanks: 460
Thanked 97 Times in 67 Posts
Default
Wp-includes .htaccess problem
Share on: 
fb share twitter share gplus share more share

I just built a new Wordpress site, and added a theme, a few plugins and created one post. Then I added some things to my .htaccess file in the wp root directory to protect certain files, as I usually do. Then I cleared cookies, etc., and tested my site to see if the files that should be protected by the .htaccess were being protected.

Well, everything checked out fine except for the wp-includes files. When I go to mywebsiteurl/wp-includes/, lo and behold, there are all the files listed for any one to see. What am I missing? I have used the exact same code for my other sites, and I have never had this problem before. Below is the code I have in the .htaccess file (outside the Wordpress tags):

<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /
RewriteRule ^wp-admin/includes/ - [F,L]
RewriteRule !^wp-includes/ - [S=3]
RewriteRule ^wp-includes/[^/]+\.php$ - [F,L]
RewriteRule ^wp-includes/js/tinymce/langs/.+\.php - [F,L]
RewriteRule ^wp-includes/theme-compat/ - [F,L]
</IfModule>

Edit: I am not using any plugins that write to the .htaccess, it is all manually added except for the part that WP writes re the permalinks.
sprucehill is offline  
Unread 27th Feb 2015, 01:16 PM   #2
HyperActive Warrior
 
Zenoth's Avatar
 
Join Date: 2014
Posts: 185
Thanks: 32
Thanked 39 Times in 34 Posts
Default
Re: Wp-includes .htaccess problem
Share on: 
fb share twitter share gplus share more share

Why don't you simply add an empty index.php file inside the wp-includes folder?

This way, when someone will try to go to www.example.com/wp-includes, he will see a blank page.

Zenoth is offline  
Unread 27th Feb 2015, 08:50 PM   #3
HyperActive Warrior
War Room Member
 
Join Date: 2011
Posts: 190
Thanks: 460
Thanked 97 Times in 67 Posts
Default
Re: Wp-includes .htaccess problem
Share on: 
fb share twitter share gplus share more share

Originally Posted by Zenoth View Post

Why don't you simply add an empty index.php file inside the wp-includes folder?

This way, when someone will try to go to www.example.com/wp-includes, he will see a blank page.
Thanks! That worked. I don't know why I didn't think of that.
sprucehill is offline  
Unread 28th Feb 2015, 01:36 AM   #4
HyperActive Warrior
 
Zenoth's Avatar
 
Join Date: 2014
Posts: 185
Thanks: 32
Thanked 39 Times in 34 Posts
Default
Re: Wp-includes .htaccess problem
Share on: 
fb share twitter share gplus share more share

Originally Posted by sprucehill View Post

Thanks! That worked. I don't know why I didn't think of that.
You're welcome .

Zenoth is offline  
Unread 4th Mar 2015, 01:28 AM   #5
Warrior Member
 
Join Date: 2015
Posts: 7
Thanks: 0
Thanked 2 Times in 1 Post
Default
Re: Wp-includes .htaccess problem
Share on: 
fb share twitter share gplus share more share

You can Disable unauthorized directory browsing by adding the following to your .htaccess
Options All -Indexes

Here are some nice snippets to Harden your website’s Security using .htaccess: .htaccess rules to Harden your website

European Web Hosting by Brontobytes
nimonogi is offline  
The Following 2 Users Say Thank You to nimonogi For This Useful Post:
Unread 5th Mar 2015, 06:47 PM   #6
HyperActive Warrior
War Room Member
 
Join Date: 2011
Posts: 190
Thanks: 460
Thanked 97 Times in 67 Posts
Default
Re: Wp-includes .htaccess problem
Share on: 
fb share twitter share gplus share more share

Originally Posted by nimonogi View Post

You can Disable unauthorized directory browsing by adding the following to your .htaccess
Options All -Indexes
I forgot to mention in my first post above that I already did that, in addition to the other code I added. It did not work - it should have, but it didn't.
sprucehill is offline  
Closed Thread


Bookmarks

Tags
htaccess, problem, wpincludes


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are Off




All times are GMT -6. The time now is 04:27 AM.