Giter VIP home page Giter VIP logo

wp-h5bp-htaccess's Issues

Release New Version with Bugfixes

After installing v2.0.0, as recommended by the readme, I came across the reference error, which was fixed in 82873f5.

Are there any plans to release a minor point update or will I have to run off of dev-master in my composer.json file?

htaccess in subfolders being blocked

Hi,

I have a wordpress blog located in a subfolder of my site (mysite.com/blog) that doesn't work because the wordpress htaccess file can't be changed from:

# 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

to this

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

# END WordPress

Every time I change the permissions of the htaccess file in the blog subfolder from 444 to 604, it immediately gets changed back again. Sometimes it stays at 604 long enough for me to make the changes through Wordpress, however as soon as the permission reverts back to 444 the original htaccess file is put back in it's place!

It's driving me mad!

Can anyone help?

Cheers, Paul.

Add rules to secure wp-includes?

It could be done with the RewriteEngine as in the example below, or it could be done with FilesMatch.

But we would have to take into account that users don't always install WordPress into their root directory, which complicates things. We could also use the typical {{double-brackets}} syntax to indicate a dynamic value, and then use PHP to determine it and change the value before adding to .htaccess file.

Securing wp-includes

A second layer of protection can be added where scripts are generally not intended to be accessed by any user. One way to do that is to block those scripts using mod_rewrite in the .htaccess file. Note: to ensure the code below is not overwritten by WordPress, place it outside the # BEGIN WordPress and # END WordPress tags in the .htaccess file. WordPress can overwrite anything between these tags.

# Block the include-only files.
<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>

Note that this won't work well on Multisite, as RewriteRule ^wp-includes/[^/]+\.php$ - [F,L] would prevent the ms-files.php file from generating images. Omitting that line will allow the code to work, but offers less security.

http://codex.wordpress.org/Hardening_WordPress#Securing_wp-includes

Placement of Directives

Shouldn't the boilerplate .htaccess directives go before the WordPress ones?

.htaccess being processed top-to-bottom, when the WordPress directives are placed earlier than the H5BP directives it means the H5BP directives are processed too late i.e. after WordPress has already processed requests.

Is this working?

I seem to be having a few problems with this.

Upon initial install of WordPress, and my theme, it does in fact create the .htaccess with the content from the h5bp-htaccess file as expected. The issue comes when editing that file and reuploading it.

I am expecting the .htaccess file in the root directory to update with the edited content, but it doesn't. I have tried flushing permalinks and this also has no affect.

The only way I am able to get it to update is to completely remove the .htaccess file from the server, then flush the permalinks.

Am I missing something here?

License.txt?

I don't mean to be obnoxious or anything. I acknowledge that you release your work out of the kindness of your heart and all that jazz, so please don't take this the wrong way.

For the sake of legal clarification, I think you should include a license.txt or license.md file. I know your current PHP file says that it's "MIT" licensed and has a URI to the license terms, but that can be misinterpreted to mean that only the PHP file is licensed. A license.txt file seems like it would be more concrete.

Vary Accept Encoding

I read that Vary Accept encoding was a good idea for performance and browser compatibility, I've added this to the h5bp-htaccess file

Fix for older browsers that don't support Compression

Suggested here - http://blog.maxcdn.com/accept-encoding-its-vary-important/

Header append Vary: Accept-Encoding Probably should do this as a pull request let me know if it's an issue. Thanks Dave

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.