0
我想從Wordpress中特定(已使用的URL)上的特定文件夾加載內容(index.html)。使用.htaccess加載特定Wordpress URL(類別URL)的文件夾
這裏的.htaccess文件(默認):
# BEGIN WordPress
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase/
RewriteRule ^index\.php$ - [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /index.php [L]
</IfModule>
# END WordPress
我這個重寫規則的一些變化的嘗試:
RewriteRule ^/category/funny-posts/ /funny-images/ [L]
這麼好笑圖像是我所在服務器上的目錄我安裝了WP。他們都在根文件夾中。
當我輸入www.site.com/category/funny-posts/時,如何從/ funny-images /加載index.html?
這實際上工作! :) 我現在需要做的唯一事情就是修復相對路徑,因爲在index.html中,而不是獲取/js/example.js,它會嘗試獲取/funny-posts/js/example.js – user1410644
很高興沒有。您只需要在對JS文件的引用中使用前導斜槓。或者,使用HTML' '標籤。 –