.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

java - Could not locate OpenAL library -

c++ - Delete matches in OpenCV (Keypoints and descriptors) -

sorting - opencl Bitonic sort with 64 bits keys -