My project is almost complete so I cannot make changes in url throughout project.whenever I use redirect like
redirect('welcome?loggedout=true', 'refresh');
Page get redirected to
welcome?loggedout=true.php
I have added URL suffix
$config['url_suffix'] = '.php';
But can I use it as optional and url remains normal with extension until I want to customise a link with .php.
Just to complement and update, you can use suffixes for some URLs only and not all your project - using routes from codeigniter. OP mentions this on his comment but provided no examples.
Here's a example: http://antsplace.co.uk/url-suffix-in-codeigniter/
I did not do the same thing. In my case, I just needed suffixes for .xml pages So I only put, on routes.php :
And created a Newsfeeds controller and index function to handle. That's it. That way only URLs with /newsfeeds on segment 1 will allways apply/accept .xml suffix
index controller function is likely many others:
Don't forget to call
header("Content-Type: application/rss+xml; charset=utf-8");
in your site header to properly render xml to this views or you can do this with codeigniter inbuilt function as described in: https://stackoverflow.com/a/10361155/2387741And at last this xml helper (docs here) help you translate some characters that need correct formatting on xml to work properly.
I guess this is it. Best regards.