如何使用htaccess删除index.php?route = in url

时间:2014-01-28 06:46:59

标签: .htaccess opencart

我在讨论支付网关cc途径方面遇到了问题。我需要更改没有特殊章程的网址

我的httaccess文件是

RewriteBase /

RewriteRule ^sitemap.xml$ index.php?route=feed/google_sitemap [L]

RewriteRule ^googlebase.xml$ index.php?route=feed/google_base [L]

RewriteRule ^download/(.*) /index.php?route=error/not_found [L]

RewriteCond %{REQUEST_FILENAME} !-f

RewriteCond %{REQUEST_FILENAME} !-d

RewriteCond %{REQUEST_URI} !.*\.(ico|gif|jpg|jpeg|png|js|css)

RewriteRule ^([^?]*) index.php?_route_=$1 [L,QSA]

任何人都可以帮助我

2 个答案:

答案 0 :(得分:0)

你的意思是这样吗?

RewriteCond %{THE_REQUEST} \ /+index\.php\?_route_=([^\ &]+)
RewriteRule ^ /%1? [L,R]

答案 1 :(得分:0)

@Jon Lin

谢谢你的回答。它的工作形式是这样的;

var data = [
    {perc:"2.2%", year:"5"},
    {perc:"3.2%", year: "7"} 
]

var Rates = React.createClass({
    render: function(){
        return (
            <div>
                <RateList data={this.props.rates} />
            </div>
        )
    }
});

var Rate = React.createClass({
    render: function(){
        return (
            <div>
                <ul>
                    <li>{this.props.percent}</li>
                </ul>
            </div>
        )
    }
});

var RateList = React.createClass({
    render: function(){
        return (
            <div>
                <ul>
                    { this.props.data.map(function(rate){
                        return <Rate percent={rate.perc} />
                    }) }
                </ul>
            </div>
        )
    }
});

ReactDOM.render(<Rates rates={data} />, document.getElementById("wow"));