Grow Your Business Online.
Submit a ticket My Tickets
Welcome
Login  Sign up

.htaccess File Untuk WordPress

Pada dasarnya WordPress membutuhkan file bernama .htaccess untuk rewrite URL serta pengaturan lainnya (biasanya berhubungan dengan plugin). Berikut aturan .htaccess settingan defaultnya.


Settingan Default WordPress


# BEGIN WordPress

RewriteEngine On
RewriteBase /
RewriteRule ^index\.php$ - [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /index.php [L]

# END WordPress



Settingan Sub folder Wordpress


Ganti my_subdir dengan sub folder Anda. Ganti example.com dengan nama domain TLD Anda.


<IfModule mod_rewrite.c>
RewriteEngine on
RewriteCond %{HTTP_HOST} ^(www.)?example.com$
RewriteCond %{REQUEST_URI} !^/my_subdir/
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ /my_subdir/$1
RewriteCond %{HTTP_HOST} ^(www.)?example.com$
RewriteRule ^(/)?$ my_subdir/index.php [L] 
</IfModule>


Did you find it helpful? Yes No

Send feedback
Sorry we couldn't be helpful. Help us improve this article with your feedback.