latest stable versions: v150827 (changelog)

Old Forums (READ-ONLY): The community now lives at WP Sharks™. If you have an s2Member® Pro question, please use our new Support System.

.htaccess – Question regarding mod_rewrite…

Home Forums Community Forum .htaccess – Question regarding mod_rewrite…

This topic contains 3 replies, has 2 voices. Last updated by  Ceefacom 3 years, 7 months ago.

Topic Author Topic
Posted: Friday May 17th, 2013 at 3:42 am #50095
Ceefacom
Username: Ceefacom

Hi Guys, I’ve had a look to see if this has been covered elsewhere, which I am guessing it has. My apologies if I’m rehashing something already covered.

We’re about to go live with a new site and I’m going through the steps for hardening WordPress. I’m following steps to add security to wp-includes, which adds some lines to .htaccess to block scripts using mod_rewrite.

The page/section I’m referring to: http://codex.wordpress.org/Hardening_WordPress#Securing_wp-includes

This isn’t my area of expertise, so when I edit .htaccess and see that S2Member has some instructions already there referring to mod_rewrite I’m not sure if adding WP’s suggested lines will interfere with it or not. Or if not, whether it’s better to stack them in a particular order, or if it doesn’t matter. Would you be able to provide any advice for me?

If it makes any difference, the site has both paid membership and a shopping cart with digital downloads (handled by another plugin). It’s not a multisite.

For reference, the S2Member lines are:

# BEGIN s2Member GZIP exclusions

RewriteEngine On
RewriteBase /
RewriteCond %{QUERY_STRING} (^|?|&)s2member_file_download=.+ [OR]
RewriteCond %{QUERY_STRING} (^|?|&)no-gzip=1
RewriteRule .* – [E=no-gzip:1]

# END s2Member GZIP exclusions

And the WP lines from the above link are:

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

List Of Topic Replies

Viewing 3 replies - 1 through 3 (of 3 total)
Author Replies
Author Replies
Posted: Monday May 20th, 2013 at 1:26 am #50210
Ceefacom
Username: Ceefacom

bump :)

Posted: Tuesday May 21st, 2013 at 4:04 am #50254
Bruce
Username: Bruce
Staff Member

Thank you for your inquiry.

Sorry for the delay in response.

This isn’t my area of expertise, so when I edit .htaccess and see that S2Member has some instructions already there referring to mod_rewrite I’m not sure if adding WP’s suggested lines will interfere with it or not. Or if not, whether it’s better to stack them in a particular order, or if it doesn’t matter. Would you be able to provide any advice for me?

No this code will not interfere with s2Member’s. You can put WordPress’s htaccess rules above or below s2Member’s, it won’t matter. s2Member is only attempting to disable GZip through htaccess rules, so it doesn’t affect anything here.

Posted: Thursday May 23rd, 2013 at 9:42 pm #50518
Ceefacom
Username: Ceefacom

Hi Bruce,

Thanks for that, very much appreciated!

Viewing 3 replies - 1 through 3 (of 3 total)

This topic is closed to new replies. Topics with no replies for 2 weeks are closed automatically.

Old Forums (READ-ONLY): The community now lives at WP Sharks™. If you have an s2Member® Pro question, please use our new Support System.

Contacting s2Member: Please use our Support Center for bug reports, pre-sale questions & technical assistance.