php去掉url上的单斜杠,Htaccess:从URL中添加/删除尾斜杠

Htaccess:从URL中添加/删除尾斜杠

我的网站运行一个名为->wss壁纸脚本的脚本。

我的问题>我一直试图强制删除或添加尾随斜杠到我的URL结束,以防止重复的内容,并清理我的URL。

我已经尝试过各种各样的尝试,尝试了我所能想到的每一件事,也试过从网上下载,但是还没有这样的运气!这可能是一个快速的解决办法,但我已经看了太多,我可能对一些非常明显的东西视而不见。

所以我把我所有的.htaccess代码:

DirectoryIndex index.php

RewriteEngine on

RewriteRule ^download/([0-9]+)?/([0-9]+)x([0-9]+)/([^/\.]+) image.php?id=$1&width=$2&height=$3&cropratio=$4&download=1 [L]

RewriteRule ^file/([0-9]+)?/([0-9]+)x([0-9]+)/([^/\.]+) image.php?id=$1&width=$2&height=$3&cropratio=$4 [L]

RewriteRule ^preview/([0-9]+)?/([0-9]+)x([0-9]+)/([^/\.]+) wallpaper_preview.php?id=$1&width=$2&height=$3&name=$4 [L]

RewriteRule ^thumbnail/([0-9]+)?/([0-9]+)x([0-9]+)/([^/\.]+)/([^/\.]+)/([^/\.]+)/([^/]+) image.php?wallpaper_id=$1&width=$2&height=$3&cropratio=$4&align=$5&valign=$6&file=$7 [L]

RewriteRule ^cat/([0-9]+)?/([^/\.]+)/p([0-9]+) index.php?task=category&id=$1&name=$2&page=$3 [L]

RewriteRule ^cat/([0-9]+)?/([^/\.]+)/([0-9a-zA-Z?-]+)/p([0-9]+) index.php?task=category&id=$1&name=$2&sortby=$3&page=$4 [L]

RewriteRule ^cat/([0-9]+)?/([^/\.]+)/([0-9a-zA-Z?-]+)-([0-9]+) index.php?task=category&id=$1&sortby=$3&page=$4 [L]

RewriteRule ^cat/([0-9]+)?/([^/\.]+) index.php?task=category&id=$1&name=$2 [L]

RewriteRule ^tag/([^/\.]+)/([0-9a-zA-Z?-]+)/([0-9]+) index.php?task=tag&t=$1&sortby=$2&page=$3 [L]

RewriteRule ^tag/([^/\.]+) index.php?task=tag&t=$1 [L]

RewriteRule ^profile/([0-9]+)?/([^/\.]+) index.php?task=profile&id=$1&name=$2 [L]

RewriteRule ^profile/comments/([0-9]+)?/([^/\.]+) index.php?task=users_comments&id=$1&name=$2 [L]

RewriteRule ^page/([0-9]+) index.php?task=view_page&id=$1 [L]

RewriteRule ^register index.php?task=register [L]

RewriteRule ^lost-password index.php?task=lost_pass [L]

RewriteRule ^links index.php?task=links [L]

RewriteRule ^news/item/([0-9]+)/([^/\.]+) index.php?task=news&id=$1 [L]

RewriteRule ^news/page([0-9]+) index.php?task=news&page=$1 [L

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值