我希望www.grabmegrub.com
重定向到www.grabmegrub.com/page/calendar
。此时它成功重定向用户并显示日历页面,但它不会更新地址栏。如何使地址栏显示www.grabmegrub.com/page/calendar
?
这里是代码,它位于根目录的.htaccess文件中:
RewriteEngine On
RewriteRule ^$ page/calendar
www.grabmegrub.com已上线。访问它,看看我在说什么。
答案 0 :(得分:0)
在const path = require('path');
const HtmlWebpackPlugin = require ( 'html-webpack-plugin' );
const webpack = require ( 'webpack' );
const PATHS = {
app: path.join( __dirname , 'src' ),
build : path.join( __dirname , 'build' )
};
module.exports = {
entry: {
app: PATHS.app
},
output: {
path: PATHS.build,
filename : '[name].js'
},
devtool: 'source-map',
module: {
loaders: [{
test: /\.js$/,
loader: 'babel-loader',
query: {
presets: ['es2015']
}
}, {
test: /\.ejs$/,
loader: 'ejs-loader'
}]
},
resolve: {
extensions: ['', '.js', '.json', 'ejs']
},
plugins: [
new HtmlWebpackPlugin({
template: path.join(PATHS.app, 'index.ejs')
}),
new webpack.ProvidePlugin({
_: "lodash"
})
]
};
指令的末尾添加R
标志:
RewriteRule
答案 1 :(得分:0)
使用此:
RewriteEngine On
RewriteRule ^page/calendar$ / [L]
它应该提供您的网址:
www.grabmegrub.com/page/calendar