0

I recently found a bug that when i go to example.com/phpmyadmin or example.com/index the trailing slash gets removed, so it's calling example.comphpadmin or example.comindex. This happens with everything after the slash. But if i have a second trailing slash like example.com/index/home it works perfectly.

I have a redirect from http to https active in my site config, running apache2.4.

My config:

<VirtualHost *:80>
    ServerName example.net
    Redirect permanent / https://example.net
</VirtualHost>

And my .htaccess:

<IfModule mod_rewrite.c>
  RewriteEngine On
  # !IMPORTANT! Set your RewriteBase here and don't forget trailing and leading
  #  slashes.
  # If your page resides at
  #  http://www.example.com/mypage/test1
  # then use
  # RewriteBase /mypage/test1/
  RewriteBase /
  RewriteCond %{REQUEST_FILENAME} !-f
  RewriteCond %{REQUEST_FILENAME} !-d
  RewriteCond $1 !^(phpmyadmin|index\.php|images|robots\.txt)
  RewriteRule ^(.*)$ index.php?/$1 [L]
</IfModule>

<IfModule !mod_rewrite.c>
  # If we don't have mod_rewrite installed, all 404's
  # can be sent to index.php, and everything works as normal.
  # Submitted by: ElliotHaughin

  ErrorDocument 404 /index.php
</IfModule>

I looked around but found no answers. Maybe there is something wrong with my config and somebody could help me.

FelixSFD
  • 6,052
  • 10
  • 43
  • 117
HypnoTox
  • 11
  • 4
  • Please don't deface your post by rolling back our improvements. – FelixSFD Dec 18 '16 at 16:12
  • Alright, sorry, I'm new to this whole site and didn't exactly see what you did to it, i thought you deleted some of the text, but as i see you changed it to code. Thanks – HypnoTox Dec 18 '16 at 16:52

2 Answers2

0

Considering that this RewriteRule doesn't even execute for /phpmyadmin due to the RewriteCond, and the RewritRule doesn't redirect, the problem is a bug in whoevers index.php you're sending all the unknown resources to.

Or, you've not shown us the actual configuration.

covener
  • 17,402
  • 2
  • 31
  • 45
0

I was being dumb and just had to clear the cache to get it working. I don't know what exactly wasn't working but my changes i made before making this post did work out, just the cache still had the faulty version in it.

HypnoTox
  • 11
  • 4