i've got a website also it was working fine basically use example.com or example.com/wp-admin

but wasn't working basically use www.example.com or www.example.com/wp-admin

i rerouted example.com to www.example.com and today neither www.example.com/wp-admin or example.com/wp-admin dont work. i recieve an empty page

here's what i acquired to date:

# 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

RewriteCond %{HTTP_HOST} example\.com$ [NC]
RewriteCond %{HTTP_HOST} !^www\.example\.com$ [NC]
RewriteRule ^(.*)$ http://www.example.com/$1 [L,R=301]

any tips on how to redirect everything but www.example.com/wp-admin ??

thanks

Are you certain the issue is the re-write rules? It may sound like www.example.com never labored.... and you are redirecting everything to www.example.com, so nothing works. You might like to make certain your DNS / virtual host is to establish correctly... www could be established to differ than non-www.

However, to reply to yoru question, just add one more condition.

RewriteCond %{HTTP_HOST} example\.com$ [NC]
RewriteCond %{HTTP_HOST} !^www\.example\.com$ [NC]
RewriteCond %{REQUEST_URI} !^/wp-admin [NC]
RewriteRule ^(.*)$ http://www.example.com/$1 [L,R=301]