久久久久久久av_日韩在线中文_看一级毛片视频_日本精品二区_成人深夜福利视频_武道仙尊动漫在线观看

用于搜索引擎友好網(wǎng)址的遞歸 mod_rewrite

Recursive mod_rewrite for search engine friendly urls(用于搜索引擎友好網(wǎng)址的遞歸 mod_rewrite)
本文介紹了用于搜索引擎友好網(wǎng)址的遞歸 mod_rewrite的處理方法,對(duì)大家解決問題具有一定的參考價(jià)值,需要的朋友們下面隨著小編來一起學(xué)習(xí)吧!

問題描述

我一直在閱讀以前的解決方案 遞歸 mod_rewrite 問題類似于我正在嘗試做的,不同之處在于我通過 index.php 文件發(fā)送所有查詢,因此不需要在詢問.

I've been reading through a previous solution to a recursive mod_rewrite problem that is similar to what I'm trying to do, the difference is I'm sending all queries through an index.php file and so don't need to specify the script within the query.

本質(zhì)上我想在搜索引擎友好的 url 中遞歸轉(zhuǎn)換任意數(shù)量的參數(shù):

Essentially I want to recursively convert any number of parameters within a search engine friendly url:

example.com/param1/val1/param2/val2/...

到常規(guī)查詢字符串:

example.com/index.php?param1=val1&param2=val2&...

到目前為止,我的嘗試都沒有成功:

So far I've been unsuccessful in in my attempts though:

RewriteCond %{QUERY_STRING} ^(.*)$
RewriteRule ^([^/]+)/([^/]+) $1=$2&%1 [L]
RewriteCond %{QUERY_STRING} ^(.*)$
RewriteRule ^(.*)$ index.php?%1 [L]

有人可以提供任何建議嗎?

Would anyone be able to offer any suggestions?

推薦答案

我從另一個(gè)問題復(fù)制了解決方案并像這樣修改:

I copied the solution from that other question and modified it like this:

RewriteCond %{QUERY_STRING} ^(.*)$
RewriteRule ^(.*/)?([^/]+)/([^/]+) $1?$2=$3&%1 [L]
RewriteCond %{QUERY_STRING} ^(.*)$
RewriteRule ^.*$ index.php?%1 [L]

它幾乎做同樣的事情,除了在第一個(gè)規(guī)則中,第一個(gè)匹配是可選的,在第二個(gè)規(guī)則中,匹配在所有其他對(duì)匹配之后剩下的任何部分.

It does nearly the same thing, except in the first rule, the first match is optional and in the second rule, the match is on whatever is left after all the other pairs are matched.

對(duì)于奇數(shù)個(gè)參數(shù),第一個(gè)參數(shù)被忽略.

For an odd number of parameters, the first parameter is ignored.

注意,如果您希望有很多參數(shù),您可能需要更改一些設(shè)置.

One note, if you expect to have a lot of parameters, you may have to change some settings.

將類似的內(nèi)容添加到您的 .htaccess 文件中

Add something like this to your .htaccess file

RewriteOptions MaxRedirects=20

和類似這樣的東西到你的 apache conf 文件

and something like this to your apache conf file

LimitInternalRecursion 20

選擇您需要允許的任意數(shù)量的遞歸(對(duì))而不是20"(默認(rèn)為 10).

Instead of "20" pick whatever number of recursions (pairs) you need to allow (the default is 10).

這篇關(guān)于用于搜索引擎友好網(wǎng)址的遞歸 mod_rewrite的文章就介紹到這了,希望我們推薦的答案對(duì)大家有所幫助,也希望大家多多支持html5模板網(wǎng)!

【網(wǎng)站聲明】本站部分內(nèi)容來源于互聯(lián)網(wǎng),旨在幫助大家更快的解決問題,如果有圖片或者內(nèi)容侵犯了您的權(quán)益,請(qǐng)聯(lián)系我們刪除處理,感謝您的支持!

相關(guān)文檔推薦

Action View Helper in Zend - Work around?(Zend 中的動(dòng)作視圖助手 - 解決方法?)
Is this a good way to match URI to class/method in PHP for MVC(這是將 URI 與 PHP 中用于 MVC 的類/方法匹配的好方法嗎)
Where do I save partial (views) in Zend Framework, to be accessible for all Views in my App?(我在哪里保存 Zend Framework 中的部分(視圖),以便我的應(yīng)用程序中的所有視圖都可以訪問?) - IT屋-程序員軟件開發(fā)技術(shù)
Having a single entry point to a website. Bad? Good? Non-issue?(有一個(gè)網(wǎng)站的單一入口點(diǎn).壞的?好的?沒問題?)
Is MVC + Service Layer common in zend or PHP?(MVC + 服務(wù)層在 Zend 或 PHP 中常見嗎?)
Hello World example in MVC approach to PHP(PHP MVC 方法中的 Hello World 示例)
主站蜘蛛池模板: 91精品一区二区三区久久久久久 | 狠狠久久| 国产高清免费视频 | 久草视频在 | 欧美黄色录像 | 国产精品视频久久久久久 | 精品乱子伦一区二区三区 | 嫩草研究影院 | 中文字幕在线观看 | 久久精品国产99国产精品 | 免费h在线 | 中文字幕久久精品 | www.中文字幕.com | 天天综合操| 国产一二三区精品视频 | 国产精品一二三区在线观看 | 色综合色综合色综合 | 久久久久国产一级毛片高清网站 | 国产免费xxx | 日本黄色激情视频 | 亚洲精品二区 | 欧美日韩亚洲视频 | 成人精品一区 | 中文字幕的av| 中文字幕一页二页 | 精品一区二区三区在线视频 | 美女在线视频一区二区三区 | 欧美精品一区二区三区在线 | 久热精品在线 | 欧美午夜精品久久久久久浪潮 | 成人二区 | 永久精品 | 亚洲www啪成人一区二区麻豆 | 99久久国产综合精品麻豆 | 丁香婷婷久久久综合精品国产 | 日本精品视频一区二区三区四区 | 久久精品一区 | 美女爽到呻吟久久久久 | 成人激情视频在线观看 | avav在线看| 亚洲av一级毛片 |