How to allow special character in URL in CI4?

26 Views Asked by At

In CI3 there was an option in config.php file to allow special characters in URL. In CI4 I'm unable to locate the setting. Can someone help ?

1

There are 1 best solutions below

0
yash adhikari On

n CodeIgniter 4, the configuration option for allowing special characters in URLs has been moved from the config.php file to the .env file.

You can set the allow_url_specialchars option to true in your .env file to allow special characters in URLs. If you don't have this option set in your .env file, you can add it manually.

Here's how you can set it in your .env file:

CI_ALLOW_SPECIAL_CHARS_IN_URL=true

After setting this option to true, CodeIgniter 4 will allow special characters in URLs.

Make sure to restart your server after making changes to the .env file for the changes to take effect.