【问题标题】:How to Remove Question marks from url using php如何使用php从url中删除问号
【发布时间】:2018-02-12 14:13:53
【问题描述】:

朋友请帮帮我,我的网址有问题 重定向我想重写我的网址

当前网址是 http://localhost/example.com/how-to-remove-question-marks?

应该被重定向为

http://localhost/example.com/how-to-remove-question-marks/

【问题讨论】:

  • 你能分享你的尝试吗?

标签: php .htaccess


【解决方案1】:

看看这个:

RewriteEngine on
# pass-through if another rewrite rule has been applied already
RewriteCond %{ENV:REDIRECT_STATUS} 200
RewriteRule ^ - [L]
# Define static redicts
RewriteRule ^image/(.+)$ public/image/$1 [L,QSA]
RewriteRule ^css/(.+)$ public/css/$1 [L,QSA]
RewriteRule ^js/(.+)$ public/js/$1 [L,QSA]
RewriteRule ^lib/js/core/(.+)$ core/lib/js/$1 [L,QSA]
RewriteRule ^lib/js/(.+)$ public/lib/js/$1 [L,QSA]
RewriteRule ^cache/(.+)$ public/cache/$1 [L,QSA]
RewriteRule ^download/(.+)$ public/download/$1 [L,QSA]

# Define custom redicts
RewriteRule ^page/([0-9]+)$ index.php?path=index.php&page=$1 [L,QSA]

RewriteRule ^(.+)$ index.php?path=$1 [L,QSA]

【讨论】:

    猜你喜欢
    • 2014-05-27
    • 2013-09-04
    • 2016-01-09
    • 2012-11-27
    • 2015-06-02
    • 1970-01-01
    • 1970-01-01
    • 2015-06-25
    • 2017-08-03
    相关资源
    最近更新 更多