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

有一個很長的 .htaccess 文件可以嗎?

Is it okay to have a very long .htaccess file?(有一個很長的 .htaccess 文件可以嗎?)
本文介紹了有一個很長的 .htaccess 文件可以嗎?的處理方法,對大家解決問題具有一定的參考價值,需要的朋友們下面隨著小編來一起學習吧!

問題描述

我向網站上的人提供網址,實際上指向一些丑陋的東西(在同一個網站上).

I am giving out URLs to people on a website, that actually point to something ugly (on the same website).

http://www.mydomain.com/cool-URL
實際上指向
http://www.mydomain.com/boring.php?id=478547&sessid=34734asdf7&otherboringdetails

我計劃在需要時通過修改 .htaccess 文件來實現這一點.我將讓 PHP 腳本寫入 .htaccess 文件,每當有新的 url 分發時添加一個新的重寫規則(非程序員可以控制的管理區域[為此指定 URL 標題)新條目,管理員:它將自動分配]).

I'm planning to achieve this by modifying the .htaccess file whenever needed. I'm going to make the PHP script write to the .htaccess file, adding a new rewrite rule whenever there is a new hand-out of a url (from an admin area a non-programmer can control [specify the URL title for this new entry, admin : it will be assigned automagically]).

這是否會成為問題,尤其是在 1000 個左右的此類 URL 之后?可接受的實際數字是多少?因為,我可以想象:服務器收到一個 URL 請求,然后它在 .htaccess 文件中搜索這個 url 的正確頁面,最后將用戶發送到正確的頁面.如果這類似于數據庫搜索,用戶可能需要很長時間才能真正到達正確的頁面...

Is this going to be a problem, especially after 1000 or so such URLs? What is the actual number that is acceptable? Because, I can picture this: the server receives a request for a URL, then it searches the .htaccess file for the right page for this url, and finally sends the user to the right page. If this is anything like Database searching, it might take a long time for the user to actually get to the right page...

請指點一下?

推薦答案

不,這不行,而且會妨礙您的頁面加載速度.

.htaccess 文件根據每個服務器請求進行評估.即使對于靜態圖像、CSS 和 JS 文件.因此,您要求網絡服務器在執行請求時解析 1000 多行可能是 REGEX 行.

.htaccess files are evaluated on EVERY server request. Even for static images, CSS and JS files. So, you're asking the webserver to parse 1000+ long possibly REGEX lines while executing a request.

此外,父目錄的 .htaccess 文件也會針對子目錄中的文件進行處理.因此,如果您的大 .htaccess 位于網站的根目錄中,那么它也會針對子目錄中的文件(以及子目錄中的 .htaccess 文件)發出的所有請求進行處理.

Also, parent directory's .htaccess file is processed for files residing in subdirectory too. So, if your large .htaccess is in root directory of website, then it will be processed for all requests made for files in the subdirectories too (along with the .htaccess file in subdirectory).

那個我的朋友正在處理很多.如果您有一個包含 10 個圖像的頁面(例如),它會處理 11 次.文件中的處理越多,所需的周期就越多.所以是的,htaccess 文件中的任何內容都會產生影響.現在這種影響明顯嗎?很難說它何時成為問題.但是它必須非常大,因為處理相對簡單,在您的情況下就是這樣.

That my friend is a lot of processing. If you have a page with 10 images (for example) it gets processes 11 times. And the more processing in the file, then the more cycles it takes. So yes, anything in a htaccess file has an impact. Now is that impact noticeable? It is hard to say when it becomes an issue. But it would have to be pretty big as the processing in relatively simple, which in your case is.

htaccess 文件的關鍵是讓它變得智能.您不想列出 200 個條目.只需幾行就可以讓它變得聰明(如果你想使用 htaccess).

The key with an htaccess file is to make it smart. You would not want to list 200 entries. You can so it smart with just a few lines (if you want to use htaccess).

這篇關于有一個很長的 .htaccess 文件可以嗎?的文章就介紹到這了,希望我們推薦的答案對大家有所幫助,也希望大家多多支持html5模板網!

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

相關文檔推薦

Action View Helper in Zend - Work around?(Zend 中的動作視圖助手 - 解決方法?)
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 中的部分(視圖),以便我的應用程序中的所有視圖都可以訪問?) - IT屋-程序員軟件開發技術
Having a single entry point to a website. Bad? Good? Non-issue?(有一個網站的單一入口點.壞的?好的?沒問題?)
Is MVC + Service Layer common in zend or PHP?(MVC + 服務層在 Zend 或 PHP 中常見嗎?)
Hello World example in MVC approach to PHP(PHP MVC 方法中的 Hello World 示例)
主站蜘蛛池模板: 在线永久看片免费的视频 | 亚洲福利一区 | 日韩中文在线观看 | 91偷拍精品一区二区三区 | 狼人伊人影院 | 中文字幕在线网 | 在线观看欧美日韩视频 | 国产亚洲一区二区精品 | 欧美一区二区三区在线观看 | 日韩在线播放第一页 | 亚洲美女网站 | 中文字幕日韩欧美 | 一区二区三区欧美 | 色婷婷综合久久久中字幕精品久久 | 日日日日操 | 久久天堂 | 欧州一区二区三区 | 国产精品自产av一区二区三区 | 玖玖操| 欧美中文在线 | 蜜桃av一区二区三区 | 久久久久成人精品亚洲国产 | 成人午夜精品一区二区三区 | 91porn在线 | 91亚洲精选 | 在线免费观看欧美 | 四虎影院在线免费观看 | 日韩a在线| 亚洲网站免费看 | 久久久久久久久久久久久九 | 香蕉视频91| 亚洲激情专区 | 国产麻豆乱码精品一区二区三区 | 国产做a爱免费视频 | 日韩欧美一区二区三区免费观看 | 韩日一区二区三区 | 成人午夜 | 狠狠干狠狠操 | 亚洲在线 | 麻豆av免费观看 | 日韩在线中文 |