问题
I'm working to create some embeds for articles on a site. The embeds call a Javascript file that figures out which article to grab from my site and makes an AJAX call to the appropriate JSON file to grab the article, parse it and then display it.
I also have a member system going which will allow people to sign up for an account telling me what site they will use the embeds on.
What I want to do is have an .htaccess file on the root folder of these JSON files so that only approved members can use the embed which makes AJAX calls to these JSON files.
The .htaccess file will have a list of allow urls that can AJAX to the folder. The thing is it will have to be updated as members are added and deleted.
What's the best way to constantly update this .htaccess file with PHP?
Many thanks in advance!
回答1:
why dont make your checks with php and hand out the files with php? its very bad practice to create rule for every single member and also will slow down the server
来源:https://stackoverflow.com/questions/39193137/writing-htaccess-file-with-php-to-update-ajax-allow-from-urls