Membuat Htaccess Standar Bawaan WordPress

Jika suatu waktu anda kehilangan file .htaccess bawaan wordpress dan ingin membuat ulang file tersebut, silakan membuat ulang file ini melalui cPanel anda dan pada menu File Manager, masuk pada subdirektori /public_html dan pilih opsi “+ File” untuk membuat file baru bernama “.htaccess” kemudian edit file ini dan masukkan entri berikut pada file /public_html/.htaccess di wordpress anda:

# 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


Jika anda menggunakan varian WordPress Multi User (WPMU) harap menggunakan konten file .htaccess berikut ini:

RewriteEngine On
RewriteBase /
RewriteRule ^index\.php$ - [L]

# add a trailing slash to /wp-admin
RewriteRule ^([_0-9a-zA-Z-]+/)?wp-admin$ $1wp-admin/ [R=301,L]

RewriteCond %{REQUEST_FILENAME} -f [OR]
RewriteCond %{REQUEST_FILENAME} -d
RewriteRule ^ - [L]
RewriteRule ^([_0-9a-zA-Z-]+/)?(wp-(content|admin|includes).*) $2 [L]
RewriteRule ^([_0-9a-zA-Z-]+/)?(.*\.php)$ $2 [L]
RewriteRule . index.php [L]
0 replies

Leave a Reply

Want to join the discussion?
Feel free to contribute!

Leave a Reply

Your email address will not be published.

 

This site uses Akismet to reduce spam. Learn how your comment data is processed.