For example, visitor types I want to remove index and show this url

In .htaccess wrote

RedirectMatch 301 /index

As result instead of get https:/// with 404 error.

Please advice what is the correct way to redirect.

Some solution.

Did it not in .htaccess, but in php file.

This works

if( trim($_SERVER['REQUEST_URI']) == '/index' ){ 
header('Location:', true, 301 );

but may be some better solution?

up vote 3 down vote accepted

You probably can find all you need in the ExpressionEngine documentation which discusses this issue and provides some sample code.

Your Answer


By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.

Not the answer you're looking for? Browse other questions tagged or ask your own question.