簡體   English   中英

將多個頁面加載為一頁

[英]Load Multiple Urls as One Page

不是100%知道如何操作,但是我知道它簡單的.htaccess,但是我不知道該怎么辦。

基本上,無論它們在包含index.php的文件夾中進入哪個url,我都希望它加載index.php文件:例如: http ://website.com/folder/thisisntafile.php將加載:名為文件夾的文件夾。 無論加載/folder/file.php都會發生這種情況。

謝謝!

嘗試這個 :

RewriteEngine on

#Rewrite "folder/file"
#don't rewrite "folder/index.php"
Rewritecond %{REQUEST_URI} !/index.php$
 RewriteCond %{REQUEST_URI} ^/([^/]+)/[^.]+(\.php|html)?$
RewriteRule ^ /%1/index.php [NC,L]

這改寫

 http://example.com/foo/bar.php

 http://example.com/foo/index.php

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM