0

Would it be possible so that http://mydomain.com/folder/index1.php could be rewritten so that anyone navigating to http://mydomain.com/folder/index1 would see index1.php if that makes sense?

Thanks

1 Answer 1

1

Yes

RewriteEngine on
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME}\.php -f
RewriteRule ^(.*)$ $1.php
Sign up to request clarification or add additional context in comments.

2 Comments

Thanks! Is there a way of setting this just to the specific file rather than having it site wide?
yes, see the last line. thats a regular expression: (.*) means match all characters. So just write a valid regex there that matches the file name.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.