本文介绍了的.htaccess重新写插入&QUOT传入的请求;?/负载="之后域名的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我需要一些帮助编码改写导入链接,这正是我需要的:

I am in need of some help with coding to rewrite incoming links, this is what I need:

传入的请求 http://mysite.com/whatever

重写

要求 http://mysite.com/?load=/whatever

所以简而言之导入链接需要通过添加修正/?负荷=立即域名之后。

so in a nutshell the incoming links need correcting by adding "/?load=" immediately after the domain name.

这些变化都需要进行更改,以我的网站导航后

The changes are required after making changes to my sites navigation

任何帮助非常AP preciated:)

Any help much appreciated :)

推荐答案

将这条规则:

RewriteEngine On

# external redirect from actual URL to pretty one
RewriteCond %{THE_REQUEST} ^[A-Z]{3,}\s/+\?load=([^\s&]+) [NC]
RewriteRule ^ /%1? [R=301,L]

# internal forward from pretty URL to actual one
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ /?load=/$1 [L,QSA]

这篇关于的.htaccess重新写插入&QUOT传入的请求;?/负载="之后域名的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

10-28 10:49