how to use .htaccess to redirect a user to:

http://www.domainname.com// на http://www.domainname.com http://www.domainname.com/// на http://www.domainname.com http://www.domainname.com/index.html/ на http://www.domainname.com http://www.domainname.com/sdfdsf/ на http://www.domainname.com 
  • tried mod_rewrite ? - Carrot - Show
  • yes but it doesn’t react to anything ( - vexel
  • one
    add code as you tried to do this. - teran
  • Plus, make sure that the .htaccess file .htaccess processed by Apache and the mod_rewrite module is connected. - de_frag
  • The file is connected and everything is OK, just do not know what to set in mod_rewrite ... is it necessary to write this regular? - vexel

1 answer 1

 Options +FollowSymLinks RewriteEngine On RewriteBase / RewriteCond %{HTTP_HOST} ^OLDDOMAIN\.com$ [NC] RewriteRule ^(.*)$ http://NEWDOMAIN.com [R=301,L]