簡體   English   中英

如何使用php正確加載主題文件

[英]How to load themes file properly using php

說到我正在工作的項目,它只是本地主機中的一個簡單網站。我是htdocs中的Xampp服務器rand,我的網站位於文件creative ,其中包含index.php文件和另一個子目錄themes ,其中進一步包含主題文件夾,其中包含所有必要的html phpcss文件可以構建我的網站。

當用戶輸入我想他從重定向index.phplocalhost/creative在index.php文件localhost/creative/themes/theme-folder 我試圖使用require_once('creative/themes/theme-folder/index.php'); 但在大多數情況下,它會失敗。 還有其他方法可以這樣做。

您可以修改.httpd文件。 然后添加:

#The path of your repositories:
DocumentRoot "C:/xampp/htdocs/creative" 

#then you make an alias:
Alias /creative "C:/xampp/htdocs/creative/themes/theme-folder"
<Directory "C:/xampp/htdocs/creative/themes/theme-folder">
    #Modify this data according to your needs
    Options Indexes FollowSymLinks
    AllowOverride all
    Order Allow,Deny
    Allow from all
</Directory> 

暫無
暫無

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

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