Skip to content

Instantly share code, notes, and snippets.

@BFTrick
Created September 12, 2012 13:39
Show Gist options
  • Star 14 You must be signed in to star a gist
  • Fork 3 You must be signed in to fork a gist
  • Save BFTrick/3706672 to your computer and use it in GitHub Desktop.
Save BFTrick/3706672 to your computer and use it in GitHub Desktop.
Default WordPress .htaccess File
# BEGIN WordPress
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /
RewriteRule ^index\.php$ - [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /index.php [L]
</IfModule>
# END WordPress
@domantasg
Copy link

thanks for this gist! It's super useful if you need to quickly revert .htaccess to default for client's WordPress site. Just copy and paste.

P.S if you cannot see .htaccess file, it's because it's hidden (https://www.hostinger.com/tutorials/create-default-wordpress-htaccess-file)

@archeoskins
Copy link

hi i have put ur given expires header coding into wordpress .htaccess file(located in public_html) when i put this code and saved. and then put my website url into chrome it has given the following error please help me how to set this ASAP.
“Internal Server Error
The server encountered an internal error or misconfiguration and was unable to complete your request.
Please contact the server administrator at webmaster@archeoskins.com to inform them of the time this error occurred, and the actions you performed just before this error.
More information about this error may be available in the server error log.
Additionally, a 500 Internal Server Error error was encountered while trying to use an ErrorDocument to handle the request.”

@evaromantik
Copy link

This is my main problem now. I mistakenly deleted my .htaccess file (for Mp3 Downloads ) and haven't been able to fix it, even after adding your code, more help please.

@pramilgawande
Copy link

@domantasg Your reply helped me solve my problem.

@ahmadbhai
Copy link

i am not able to resolve .htaccess problem please check sir and let me know what is the actual problem occuring in my Vidyanidhi.org.in

@ttodua
Copy link

ttodua commented Dec 13, 2020

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment