0

I've spent the last two hours reading stackoverflow and the apache manual trying to find a solution to this, but haven't found any, if a directory is access (http://domain.ext) I'd like to force index.php to appear in the url (http://domain.ext/index.php) if possible.

If anyone could help I'd really appreciate it, thank you.

RewriteEngine on
RewriteRule index.php

2 Answers 2

2

you can use this:

RewriteEngine on RewriteRule ^$ /index.php?

(but you will not see it in a browser because the rewrite engine just directs to the correct file/directory without changing the url from the browser)

with [R] tag you can redirect the user so the new url would appear in the browser

Sign up to request clarification or add additional context in comments.

Comments

1

I've just found what works for me

RewriteEngine On
RewriteRule ^/?$ $1/folder/index.php$2 [R=301,L]

Comments

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.