.htaccess RewriteRule将php显示为cfm

时间:2016-02-14 20:38:21

标签: php .htaccess

当前.htaccess无效:

$('.radioGroup').on('change',function(){

var args=JSON.stringify({qId:'tt1',qAns: 'aa1'});
$.ajax({
    url:'${createLink(controller:'questions' , action:'tempSaveAjax')}',
    type:'POST' ,
    data:{ json:args }, 
    success: function(data, textStatus, jqXHR) {
        alert (" done " );
            },
    error: function(data,  textStatus,  errorThrown) { // Handle errors here
        alert ("erroooor : " + textStatus/*data.responseText*/);
        }

    });

});

目前的语法是:

RewriteRule ^search\.cfm?q=(.*)$ index.php?current=search&q=$1 [NC,L]

新语法:

index.php?current=search&q=stackoverflow

1 个答案:

答案 0 :(得分:1)

根据您的要求,这应该是您所需要的。

RewriteRule ^search\.cfm$ index.php?current=search [NC,L,QSA]

QSA标记将q=查询字符串追加回.php文件。