小编Avi*_*ida的帖子

Apache、htaccess、url重写

我有.htaccess我使用的文件进行测试,这是我的文件:

RewriteEngine On
RewriteCond %{REQUEST_URI} ^/([a-z-]+)/?$ [NC]
RewriteRule ^ %{REQUEST_SCHEME}://%{SERVER_NAME}/?title=%1 [L]
Run Code Online (Sandbox Code Playgroud)

我正在使用来自ApacheLounge 的Apache/2.4.10 (Win32)

I have the following domain and sub domain:

  • example.com
  • m.example.com

Both point to the same ip address, now as I expected from the above .htaccess:

if I access example.com/Article-Name/ the redirection to example.com/?title=Article-Name will be internal, I won't be able to see ?title=Article-Name on my url bar.

Here is the exception:

If I access m.example.com/Article-Name/ the redirection to …

mod-rewrite .htaccess apache-2.4

2
推荐指数
1
解决办法
1424
查看次数

标签 统计

.htaccess ×1

apache-2.4 ×1

mod-rewrite ×1