Title: .htaccess File
Last modified: January 13, 2021

---

# .htaccess File

 *  [banothuthiru](https://wordpress.org/support/users/banothuthiru/)
 * (@banothuthiru)
 * [5 years, 7 months ago](https://wordpress.org/support/topic/htaccess-file-37/)
 * Hi,
    Here I’m facing one issue from long time I want to edit my .htaccess file
   and I need to add some code in it from the cPanel I did it and saved but the 
   thing is the code which i have added to that file is not saving into .htaccess
   file can any one help me solving this issue.
 * The page I need help with: _[[log in](https://login.wordpress.org/?redirect_to=https%3A%2F%2Fwordpress.org%2Fsupport%2Ftopic%2Fhtaccess-file-37%2F%3Foutput_format%3Dmd&locale=en_US)
   to see the link]_

Viewing 7 replies - 1 through 7 (of 7 total)

 *  [Davood Denavi](https://wordpress.org/support/users/binarywc/)
 * (@binarywc)
 * [5 years, 7 months ago](https://wordpress.org/support/topic/htaccess-file-37/#post-13900397)
 * It is hard to provide support without knowing the code you are trying to add 
   to your sites .htaccess. Sometimes the code does not belong in the htaccess file.
   Please provide further info about what you are trying to add to your htaccess
   and I will do my best to help you, if I am not able to someone else here in the
   community might be able to.
 *  Thread Starter [banothuthiru](https://wordpress.org/support/users/banothuthiru/)
 * (@banothuthiru)
 * [5 years, 7 months ago](https://wordpress.org/support/topic/htaccess-file-37/#post-13900427)
 * Hi Davood Denavi,
 * Thank for your response .
 * I need to add some code that is related “expire headers” & Directory Listing 
   enable.
 *  [Davood Denavi](https://wordpress.org/support/users/binarywc/)
 * (@binarywc)
 * [5 years, 7 months ago](https://wordpress.org/support/topic/htaccess-file-37/#post-13900644)
 * This still doesn’t allow us to help you very well… do you have the code you’re
   adding? Please share it.
 * Also, the code might be different based on your hosting/server provider. You 
   might be better off contacting your provider for support.
 *  Thread Starter [banothuthiru](https://wordpress.org/support/users/banothuthiru/)
 * (@banothuthiru)
 * [5 years, 7 months ago](https://wordpress.org/support/topic/htaccess-file-37/#post-13921093)
 * Hi Davood Denavi,
 * I need to add the following code : Optional -Indexes
    to .htaccess file need 
   to save it permanently
 *  [Davood Denavi](https://wordpress.org/support/users/binarywc/)
 * (@binarywc)
 * [5 years, 7 months ago](https://wordpress.org/support/topic/htaccess-file-37/#post-13925202)
 * htaccess is directory specific so you will need to add the exact line you just
   shared into an htaccess file for each directory you want that option to be active
   for. Where it comes to adding it to htaccess you have the correct line that needs
   to be added. I usually add it to the bottom of the file if there is other code
   in the htaccess for the directory I am adding it to. Beyond that the only way
   it will not be added permanently is if you or someone else helping you manage
   the website accidentally deletes the htaccess file from a specific directory.
 *  Thread Starter [banothuthiru](https://wordpress.org/support/users/banothuthiru/)
 * (@banothuthiru)
 * [5 years, 7 months ago](https://wordpress.org/support/topic/htaccess-file-37/#post-13930717)
 * Hi Davood Denavi,
 * Thanks for your response
    I have added those line end of the htaccess file and
   saved it by that time it shows saved but the thing is when perform the action
   its remains none if i open the htaccess file the code which I added disappeared
   please help me.
 *  [Davood Denavi](https://wordpress.org/support/users/binarywc/)
 * (@binarywc)
 * [5 years, 7 months ago](https://wordpress.org/support/topic/htaccess-file-37/#post-13934797)
 * the htaccess file must be saved with a period in front of it (.htaccess) else
   the code inside of it is ignored by most servers. Also, I’ve had experiences 
   where the code you are trying to implement needs to be at the top of the .htaccess
   file due to a server configuration issue in order to not be ignored. One last
   thing I would suggest is to contact your hosting provider and ask theme if there
   is another way to add this setting without editing the htaccess file… I did work
   with one client in the past who’s hosting provider had a custom option available
   server-side that was able to do this outside of the htaccess file using a checkbox
   within the control panel.
 * This is a volunteer based forum so beyond the advice and guidance I’ve already
   provided I will not be able to help much further. However, another volunteer 
   here might have insight and knowledge different from mine based on their experience
   with such issues as you are describing.

Viewing 7 replies - 1 through 7 (of 7 total)

The topic ‘.htaccess File’ is closed to new replies.

 * In: [Everything else WordPress](https://wordpress.org/support/forum/miscellaneous/)
 * 7 replies
 * 2 participants
 * Last reply from: [Davood Denavi](https://wordpress.org/support/users/binarywc/)
 * Last activity: [5 years, 7 months ago](https://wordpress.org/support/topic/htaccess-file-37/#post-13934797)
 * Status: not resolved

## Topics

### Topics with no replies

### Non-support topics

### Resolved topics

### Unresolved topics

### All topics
