.htaccess - htaccess redirect if URI contains string to index.php -


i redirect link http://example.com/asdasdas/edit http://example.com/asdasdas/index.php/edit using htaccess. did this:

rewriteengine on rewritecond %{request_filename} !-f rewritecond %{request_filename} !-d rewritecond %{request_uri} edit rewriterule ^ %{request_uri}/index.php [l,r=301] 

but it's loop , doesn't works well. ideas?

you can use rule in /asdasdas/.htaccess:

rewriteengine on rewritebase /asdasdas/  rewritecond %{request_filename} !-f rewritecond %{request_filename} !-d rewriterule (.+) index.php/$ [l] 

this support url of http://example.com/asdasdas/edit


Comments

Popular posts from this blog

node.js - How to mock a third-party api calls in the backend -

java - Could not locate OpenAL library -

Non Unique Username with ASP.Net Identity 2.0 -