My .htaccess file contains url mappings and my script create these entries once a day.
As .htaccess is a hidden file on Server, when the script tries to overwrite this .htaccess file I get
an error message Access Denied.
Is there a way to overwrite the file.
I suspect that the problem here is that you’re on Windows, and Windows doesn’t especially like filenames that begin with a dot (it thinks you’re creating a file with an empty “name”, and a “htaccess” extension).
The fastest solution might just be to change the name of the file that Apache’s looking for to e.g.
htaccess.txtusing theAccessFileNamedirective.