我的页面结构已经有一段时间了:https://www.(DOMAIN).(TLD)/page/(SLUG)
现在我想将其更改为:https://www.(DOMAIN).(TLD)/(SLUG)
我怎样才能做到最好?
这就是我已经拥有的:
RewriteEngine On
# Include "www" and change "http" to "https".
RewriteCond %{HTTP_HOST} !^www\.
RewriteRule ^(.*)$ https://www.%{HTTP_HOST}%{REQUEST_URI} [L,R=301]
RewriteCond %{HTTPS} off
RewriteRule ^(.*)$ https://%{HTTP_HOST}%{REQUEST_URI} [L,R=301]
# Ignore some stuff.
RewriteBase /
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
# The page part.
RewriteRule ^([a-zA-Z0-9/_\-]+)$ index.php?mode=page&slug=$1 [NC]
RewriteRule ^([a-zA-Z0-9/_\-]+)/$ index.php?mode=page&slug=$1 [NC,L]
# Redirect /page/SLUG to /SLUG?
答案 0 :(得分:1)
尝试以下条件和规则,
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^([a-zA-Z0-9/_\-]+)/?$ index.php?mode=page&slug=$1 [NC,L]
答案 1 :(得分:0)
这样的事情:
drawer.closeDrawer(drawerListView, false);