htaccess redirection and would like to redirect all visitors on (domain.com, domain.com/,domain.com/index.php ) to http://www.domain.com/index.php#block_1 . below is my rules in .htaccess
RewriteEngine on
RewriteCond %{HTTP_HOST} ^domain.com [NC]
RewriteRule ^(.*)$ http://www.domain.com/$1 [L,R=301]
RewriteRule index\.php index.php#block_1 [NE]
i keep getting error 500, Some one point what im doing wrong
I believe the error is because you’re specifying an internal (Non-HTTP) redirect, which happens to send apache into a redirect loop.
Try:
Because browsers never send the anchor part of the URL string to the server, you cannot test for it, so this will likely cause an infinite HTTP redirect loop for the client.
You will likely have to redirect to a second page, like this.
The mod_rewrite documentation explains it all.