【发布时间】:2020-02-07 14:23:28
【问题描述】:
我来这里是想就我无法按照自己的意愿配置的 .htaccess 文件征求意见。
我有一个网站,比如说: www.mysite.com/php/blog.php
我希望访问者只在地址栏中看到: www.mysite.com/blog
这是 .htaccess 文件包含的内容:
Options +FollowSymlinks
Options All -Indexes
RewriteEngine On
RewriteRule ^$ index.php #This line is to hide index.php on the home page, maybe it's not the right way to do it
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^php/([0-9a-zA-Z]+).php$ $1 [L] #I tried to write this, but it doesn't work
RewriteCond %{HTTPS} off
RewriteRule (.*) https://%{HTTP_HOST}%{REQUEST_URI} [R=301,L]
我怀疑这个问题已经问过很多次了,但是我真的试过了,没有成功。
你能帮帮我吗? 谢谢!
【问题讨论】: