apache - Setting the HTACCESS file to redirect all .cfm requests to index.php -


i have .htaccess rewrite rule wrote, supposed take requests container index.cfm , redirect them index.php.

http://testsite.com/index.cfm/a/catalog.prodshow/vid/42110/catid/154

however, not redirecting properly. if put in index.cfm (no rest of url) works fine, however, moment /a/... added it, takes me 404 page.

how adjust rule works url has index.cfm anywhere in it?

here rule:

rewriterule ^index.cfm$ /index.php [l,nc,r]

thanks.

in rewriterule, ^ , $ indicate start , end of line. if wish match index.cfm (like /index.cfm/a/... or /sub1/sub2/index.cfm/...) can try:

rewriterule ^(.*index.cfm.*)$ /index.php?original_url=$1 [l,nc] 

i added original url parameter because might need process request , removed r flag avoid loops.


Comments

Popular posts from this blog

searchKeyword not working in AngularJS filter -

sequelize.js - Sequelize: sort by enum cases -

user interface - how to replace an ongoing process of image capture from another process call over the same ImageLabel in python's GUI TKinter -