mark107 Posted May 16, 2014 Share Posted May 16, 2014 Hi guys, I need your help. I have .xml file in download directory on my server. whoever visit my site page (Myxmlfilename.xml) user should be able to download these files and other files should not. I am trying to achieve above but no luck... does anyone know how I can access to Myxmlfilename.xml to download the xml file? thank you in advance. Quote Link to comment https://forums.phpfreaks.com/topic/288549-htaccess-xml-file-downlaods/ Share on other sites More sharing options...
requinix Posted May 16, 2014 Share Posted May 16, 2014 Use your favorite mechanism for restricting access (like an Order), and then use a to override that specifically for Myxmlfilename.xml. Quote Link to comment https://forums.phpfreaks.com/topic/288549-htaccess-xml-file-downlaods/#findComment-1479760 Share on other sites More sharing options...
mark107 Posted May 16, 2014 Author Share Posted May 16, 2014 How I can open the htaccess to change the policies to allow me to download the Myxmlfilename.xml? I have no idea how to open the htaccess. Quote Link to comment https://forums.phpfreaks.com/topic/288549-htaccess-xml-file-downlaods/#findComment-1479761 Share on other sites More sharing options...
Solution requinix Posted May 16, 2014 Solution Share Posted May 16, 2014 It's a file. If you don't have one then make it - it goes in the folder that contains that XML file. Inside it, use an Order to limit access to everything, # deny by default Order allow,denythen a with an Allow that grants access instead. <Files "Myxmlfilename.xml"> Allow from all </Files> Quote Link to comment https://forums.phpfreaks.com/topic/288549-htaccess-xml-file-downlaods/#findComment-1479778 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.