M
M
MrGruffi2014-03-16 22:55:39
PHP
MrGruffi, 2014-03-16 22:55:39

.htaccess - how to replace url?

www.domain.com/php/index.php
With the help of mod_rewrite you need to convert this to the form
www.domain.com
Here is what I did for an example:

RewriteEngine on
RewriteRule index.php php/index.php [L]

However, this only works if
www.domain.com/index.php is crooked
. But the point is clear, I think.

Answer the question

In order to leave comments, you need to log in

1 answer(s)
S
Stepan, 2014-03-16
@MrGruffi

Add
DirectoryIndex to index.php before the rewrite
Or do you want it to work for more than just the index.php file?

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question