Php include into another php file

Post Reply
Master Bludit
Posts: 106
Joined: Wed Jan 29, 2020 8:32 pm


I would like to ask how can I call a bludit index.php file installed in a subdirectory?

I try these, but I can only call index.php if it is in the same directory.
What would be a good method for a subdirectory?

<?php include ('index.php'); ?> it works
<?php include ('another/index.php'); ?> it is not

I would like to integrate bludit with another page, but not with iframe.

User avatar
Site Admin
Posts: 2385
Joined: Sun Aug 09, 2015 5:01 pm
Location: Zurich

It depends from the server configuration. You can try to set in the file .htaccess:

Code: Select all

# Base directory
RewriteBase /another/
Planet Bludit, Tipps, Snippets und nützliche Links. - Newsletter, Informationen zu Bludit (auf Deutsch).
Master Bludit
Posts: 106
Joined: Wed Jan 29, 2020 8:32 pm

Thank you very much. I haven't had time to try it yet, but it seems like a good solution.
If I can tell you.
Master Bludit
Posts: 106
Joined: Wed Jan 29, 2020 8:32 pm


I tried what you recommended, but unfortunately I couldn't solve it.
I get this message: Install Bludit first.

the structure of the website is as follows:

the public_html directory has an index.php this is where the web page starts

this contains the bludit directory and bludit cms starts from the index.php file there

but if I call it in public_html with the include command

  <? Php
include ( './ bludit / index.php')

then I get the message: Install Bludit first

If I provide only one link:
that's fine, but in this case I can't edit it because it doesn't open from a single page

a htacces file it looks like this:

AddDefaultCharset UTF-8

<IfModule mod_rewrite.c>

# Enable rewrite rules
RewriteEngine on

# Base directory
RewriteBase /bludit/

# Deny direct access to the next directories
RewriteRule ^bl-content/(databases|workspaces|pages|tmp)/.*$ - [R=404,L]

# All URL process by index.php
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*) index.php [PT,L]


Based on these, would you still have an idea?

User avatar
Master Bludit
Posts: 133
Joined: Mon Feb 11, 2019 8:41 pm

You've got to declare absolute path to directory before you use relative path to file.
Read about "include" function on
Post Reply