如何将https://www.themaidsofcharleston.com/?Itemid=重定向到https://www.themaidsofcharleston.com/
我试过了
RewriteCond %{QUERY_STRING} ^?Itemid=$
RewriteRule ^/$ /? [R=301,L]
但是ID不起作用
提前谢谢。
答案 0 :(得分:0)
需要解决两个问题:
{QUERY_STRING}
不包含主要问号 - 您要查看^Itemid=$
在.htaccess上下文中配置重写时,路径永远不会以/
开始,该^$
已经在该点被剥离。因此,您的规则需要匹配空路径def neural_network_model(data, layer_sizes):
num_layers = len(layer_sizes) - 1 # hidden and output layers
layers = [] # hidden and output layers
# initialise the weights
weights = {}
for i in range(num_layers):
w_name = 'W' + str(i+1)
b_name = 'b' + str(i+1)
w = tf.get_variable(w_name, [layer_sizes[i], layer_sizes[i+1]],
initializer = tf.contrib.layers.xavier_initializer(), dtype=tf.float32)
b = tf.get_variable(b_name, [layer_sizes[i+1]],
initializer = tf.zeros_initializer(), dtype=tf.float32)
layers.append({'weights': w, 'biases': b})
weights[w_name] = w
# save the weights dictionary
saver = tf.train.Saver(var_list=weights)
with tf.Session() as sess:
sess.run(init)
save_path = saver.save(sess, path + 'weights.ckpt') # path is set elsewhere