Permalink di wordpress : Setting .htaccess dan httpd.conf

Oleh : Reza Ervani

بسم الله الرحمن الرحيم

Agar permalink kita tampil lebih sederhana, kita dapat memanfaatkan modul rewrite yang secara default sudah terinstall di httpd, baik itu centos 6 maupun centOS 7.

Pertama konfigurasi di /etc/httpd/conf/httpd.conf

Pastikan bagian :

[code language=”bash”]

#
# AllowOverride controls what directives may be placed in .htaccess files.
# It can be "All", "None", or any combination of the keywords:
# Options FileInfo AuthConfig Limit
#
AllowOverride None

#

[/code]

Dirubah jadi :

[code language=”bash”]

AllowOverride All

[/code]

Di bagian VirtualHost, pastikan direktori tempat anda meletakkan file-file wordpress dapat dioverride dengan menambahkan baris berikut :

[code language=”bash”]

<Directory /home/eclipse/public_html/programming.rezaervani.com/public>
AllowOverride All
</Directory>

[/code]

Sehingga nampak seperti contoh berikut :

[code language=”bash”]

<VirtualHost *:80>

ServerName programming.rezaervani.com
ServerAlias www.programming.rezaervani.com
ServerAdmin reza@rumahilmu.or.id
DocumentRoot /home/eclipse/public_html/programming.rezaervani.com/public
ErrorLog /home/eclipse/public_html/programming.rezaervani.com/log/error_log

<Directory /home/eclipse/public_html/programming.rezaervani.com/public>
AllowOverride All
</Directory>

</VirtualHost>
[/code]

Setelah itu anda dapat membuat file .htaccess yang isinya seperti ini :

[code language=”bash”]

RewriteOptions inherit
# 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>

[/code]

Tempatkan file tersebut di direktori utama tempat anda meletakkan file-file wordpress

Demikian, semoga bermanfaat

About Reza Ervani 425 Articles
Adalah pendiri programming.rezaervani.com -

Be the first to comment

Leave a Reply

Your email address will not be published.


*


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