使用参数将.htaccess从文件夹重定向到域

时间:2016-11-10 16:59:47

标签: .htaccess redirect

我只需要将带参数的文件夹重定向到新域,例如:

www.domain.it/en/page/2/products

www.domain.com/page/2/products

我是怎么做到的?

我试过这个,但不适合我的蠢事:

RewriteCond $1 !/$
RewriteCond %{REQUEST_FILENAME}/en/ -d
RewriteRule (.+) http://www.domain.com/$1/ [R=301,L]

1 个答案:

答案 0 :(得分:0)

您可以使用以下基于mod-alias的解决方案

'use strict';

import React, {Component} from 'react';
import AuthStore from '../stores/AuthStore';

// Creates Spin Button
class PlayButton extends Component {

    constructor() {
        super();
        this.state = {
            authenticated: AuthStore.isAuthenticated()
        }
    }

    render() {
        //console.log(this, this.props, this.state.authenticated);
        return (
            <div>
            {!this.state.authenticated ? (
                <div className="medium-4 small-12">
                    <button id="play-button" className="play-button" onClick={this.props.login.bind(this)}>Play!</button>
                </div>
            ) : (
                <div className="medium-4 small-12">
                    <button id="play-button" className="play-button" onClick={this.props.logout.bind(this)}>Log out!</button>
                </div>
            )}
            </div>
        );
    }

}

export default PlayButton;