sayedsohail Posted September 14, 2007 Share Posted September 14, 2007 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 More sharing options...
Wuhtzu Posted September 14, 2007 Share Posted September 14, 2007 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... Link to comment https://forums.phpfreaks.com/topic/69361-how-to-include-subdirectory/#findComment-348498 Share on other sites More sharing options...
sayedsohail Posted September 14, 2007 Author Share Posted September 14, 2007 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 Link to comment https://forums.phpfreaks.com/topic/69361-how-to-include-subdirectory/#findComment-348501 Share on other sites More sharing options...
hackerkts Posted September 14, 2007 Share Posted September 14, 2007 Options +Indexes Options +FollowSymlinks RewriteEngine on RewriteRule ^(.*)/search.php$ $1/abc/search.php Not sure if that works. Link to comment https://forums.phpfreaks.com/topic/69361-how-to-include-subdirectory/#findComment-348511 Share on other sites More sharing options...
Wuhtzu Posted September 14, 2007 Share Posted September 14, 2007 yup that would be a task for Mod Rewrite... Link to comment https://forums.phpfreaks.com/topic/69361-how-to-include-subdirectory/#findComment-348536 Share on other sites More sharing options...
sayedsohail Posted September 14, 2007 Author Share Posted September 14, 2007 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? Link to comment https://forums.phpfreaks.com/topic/69361-how-to-include-subdirectory/#findComment-348608 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.