Jump to content

how to include subdirectory?


sayedsohail

Recommended Posts

Hi,

 

I am serving my files from htdocs/xyz, but than again i created a sub-directory underneath xyz/abc,  How do i instruct apache to look for files in xyz and aswell as abc which is a sub-directory of xyz.

 

I am not sure how to configure is it through php or .htaccess file?

 

Please advise.

Link to comment
https://forums.phpfreaks.com/topic/69361-how-to-include-subdirectory/
Share on other sites

I'm not an apache expert, but if you have htdocs/xyz/ as your document root then you will simply access /abc/ by adding it to your address?

 

domain.com/abc/file.ext

 

Maybe a more detailed description of your problem would be good... :)

well, i can access the file if type the complete url:

 

xyz is my parent folder and abc is the sub folder for xyz

 

my index.php file is inside the xyz and if i typed http://localhost/xyz/index.php it works fine

 

my search.php file is stored inside the sub folder abc, i wish to call search.php file without typing the full url address.

 

i.e, http://localhost/xyz/search.php  instead of http://localhost/xyz/abc/search.php

 

 

yes, i tried this but it doesn't work for me either.

 

created a .htaccess file and added this code.

 

 

Code:

 

IndexIgnore */*

<Files .htaccess>

order allow,deny

deny from all

</Files>

 

RewriteEngine On

RewriteRule ^(.*)/localhost/xyz/search.php$ $1/localhost/xyz/abc/search.php

 

 

 

but still it doesn't work?

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.