0

I am trying to redirect the index.php to /, at the Document root: /var/www/ by configuring the /etc/apache2/sites-enabled/000-default file.
Using Ubuntu 14.04 Server with apache2.

These are the contents of the Directory directive at /etc/apache2/sites-available/000-default:

Options Indexes FollowSymLinks MultiViews AllowOverride None Require all granted

This is what I've tried from another question here:

<Directory "/var/www">
     Options Indexes FollowSymLinks MultiViews
     AllowOverride None
     Require all granted
     RewriteCond %{THE_REQUEST} ^/index.php$
     RewriteRule $(.*)^ / [R=301,L]
</Directory>

I've even tried this RewriteRule ^(.*)index\.(php|html?)$ /$1 [R=301,NC,L], and also RedirectMatch 301 ^/index.php$ http://www.example.com (this time I removed, the RewriteCond).

What happens
I can normally access my site from /, but when I add /index.php I get redirected to wwww.mydomain.com (notice the 4 ws).

What am I doing wrong?

Community
  • 1
  • 1
Chris
  • 3,619
  • 8
  • 44
  • 64
  • I assume the extra "w" is coming from somewhere else. Is there anything else you can share? – cleaver Oct 23 '14 at 15:22
  • @cleaver Yes that's what I think as well, could you please suggest some other files to look? – Chris Oct 23 '14 at 20:16

0 Answers0