Question

when somebody visits

http://127.0.0.1/something

I want to redirect him to

http://127.0.0.1/something/index.php

using .htaccess.

  1. How can I do that?
  2. Is it possible to do that without showing the user that they got redirected, like YouTube does (YouTube.com/user/channel/videos/)

Thanks in advance!

Was it helpful?

Solution

I finally found out how to do it.

Warning: I have no experience with mod_rewrite, so this may not be the best solution. It works for me though.

<IfModule mod_rewrite.c>
RewriteEngine On
RewriteCond %{REQUESTFILENAME} !-f
RewriteRule ^(.*)/$ /$1/index.php [L]
</IfModule>
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top