Welcome Guest, Not a member yet? Register   Sign In
Best way to remove index.php and redirect to https
#1

Hey all,
I am trying to work out the best way to first remove the index.php from the URL and redirect to 'HTTPS' without causing 2 redirects. I prefer it to be done in a single redirect if possible. Any ideas would be great!
Thanks,
Reply
#2

Remove the index.php, set the Index file in the config.php file to blank
Code:
/*
|--------------------------------------------------------------------------
| Index File
|--------------------------------------------------------------------------
|
| Typically this will be your index.php file, unless you've renamed it to
| something else. If you are using mod_rewrite to remove the page set this
| variable so that it is blank.
|
*/
$config['index_page'] = '';

To force https you can do that in the htaccess file (which you will also need to set correctly to use mod_rewrite above)

Which i would search for proper scenarios to match your needs on that
Reply
#3

It will be best if you have 2 redirect rules.

1st redirect to HTTPS all traffic - this will be common redirect as many clients don't enter https each time..
2nd remove index.php from the request - if you DON'T generate such url's with containing index.php there wont be many redirect regarding this case. So there is no point to mess it with the https rule.
Best VPS Hosting : Digital Ocean
Reply




Theme © iAndrew 2016 - Forum software by © MyBB