- I want to remove index.php from the middle of the URL.
- I am using Dreamhost Webhosting.
- And Believe me, Dreamhost Webhosting configuration is very different from others.
- Normal Webhosting configuration is not working in Dreamhost.
Here is the problem I am facing:
PROBLEM 1:
The link below:
https://www.example.com/index.php/gallery
Should redirect to:
https://www.example.com/gallery
PROBLEM 2:
The link below:
https://www.example.com/index.php/profile/juhi/168
Should redirect to:
https://www.example.com/profile/juhi/168
PROBLEM 3:
The link below:
https://www.example.com/index.php
Should redirect to:
https://www.example.com/
htaccess code is below:
RewriteEngine On
# Existing files and directories remain accessible
RewriteCond %{REQUEST_FILENAME} -f [OR]
RewriteCond %{REQUEST_FILENAME} -d
RewriteRule ^.* - [L]
# Redirect the rest
RewriteCond $1 !^(index\.php|images|robots\.txt)
RewriteRule ^(.*)$ /index.php?/$1 [QSA,L]