S2Member Causes Internal Server Error

S2Member is my favorite membership plugin for WordPress. I have spent quite some time digging this plugin, and been able to tailor some of its features to meet my clients’ requirement. I’ve done quite a few S2Member installations without any headache until just now.


The Symptom

The error comes right to the end of the fresh installation. Instead of seeing the plan yet friendly “successful” information, you get this:


As we all know this is not even start process any WordPress scripts yet, the regular debugging process, i.e., turn on WordPress DEBUG mode isn’t going to help. Disable the plugin or even delete the folder won’t help either.

The Solution

Without wasting much time, I looked into the error log. And here is what I got:

[Sat Jun 22 23:35:11 2013] [alert] [client] /var/www/inspiration/public_html/.htaccess: RewriteBase: argument is not a valid URL, referer: http://inspiration.lamp/wp-admin/update.php?action=install-plugin&plugin=s2member&_wpnonce=da0c0c6244

Needless to say, I need to look at the .htaccess file for further clue. Here is what in my file:

# BEGIN s2Member GZIP exclusions
<IfModule mod_rewrite.c>
	RewriteEngine On
	RewriteBase client_inspiration
	RewriteCond %{QUERY_STRING} (^|\?|&amp;)s2member_file_download\=.+ [OR]
	RewriteCond %{QUERY_STRING} (^|\?|&amp;)no-gzip\=1
	RewriteRule .* - [E=no-gzip:1]
# END s2Member GZIP exclusions

# 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]
# END WordPress

The hightlighted lines indicate the cause of the problem. Apparently, S2Member didn’t get this part right for whatever reason. I replaced line 4 to:

RewriteBase /

and the error is gone.

[Plugin] S2Member Framework (Member Roles, Capabilities, Membership, PayPal Members)

s2Member® (WordPress Membership Plugin)