{ID} - 3.3.4 Apache dan mod_rewrite
Sementara CakePHP ditulis untuk bekerja dengan mod_rewrite di luar kotak- dan biasanya tanpa masalah-kami mengetahui ada beberapa pengguna berjuang mendapatkan semua itu bekerja secara apik di sistem mereka. Inilah beberapa hal yang perlu Anda coba untuk mendapatkannya bekerja secara tepat:
- Pastikan .htaccess override diperbolehkan. Dalam httpd.conf, Anda perlu memiliki bagian yang mendefinisikan Directory Anda pada server. Pastikan AllowOverride diset ke All untuk DocumentRoot yang sesuai.
- Pastikan Anda menyunting httpd.conf sistem, bukan httpf.conf user- atau site-tertentu.
- Apakah CakePHP tidak menemukan berkas .htaccess yang dibutuhkannya? Hal ini kadang terjadi saat menyalin atau memindahkan karena beberapa sistem operasi memperlakukan berkas dengan awalan '.' sebgai berkas tersembunyi. Pastikan salinan CakePHP Anda berasal dari bagian unduhan di situs atau repsitori SVN kami, dan telah di mekarkan secara benar.
- Pastikan Anda memuat mod_rewrite secara benar. Anda akan mendapatkan sesuatu seperti LoadModule rewrite_module libexec/httpd/mod_rewrite.so (pengguna Linux/Unix perlu juga melihat sesuatu seperti AddModule mod_rewrite.c) dalam httpd.conf Anda. Juga pastikan tidak berupa komentar (dengan penambahan # di awal). Restart Apache untuk memastikan tata conf Anda aktif.
- Jika Anda menginstal CakePHP ke dalam direktori pengguna (http://example.com/~username), Anda perlu mengubah berkas .htaccess dalam base direktori tempat instalasi CakePHP Anda. Cukup tambahkan baris "RewriteBase /~myusername/".
{EN} - 3.3.4 Apache and mod_rewrite
While CakePHP is built to work with mod_rewrite out of the box–and usually does–we've noticed that a few users struggle with getting everything to play nicely on their systems. Here are a few things you might try to get it running correctly:
- Make sure that an .htaccess override is allowed. In your httpd.conf, you should have a section that defines your Directory on the server. Make sure the AllowOverride is set to All for the correct DocumentRoot.
- Make sure you are editing the system httpd.conf rather than a user- or site-specific httpd.conf.
- Is CakePHP missing its needed .htaccess files? This sometimes happens during copying or moving because some operating systems treat files that start with '.' as hidden. Make sure your copy of CakePHP is from the downloads section of the site or our SVN repository, and has been unpacked correctly.
- Make sure you are loading up mod_rewrite correctly. You should see something like LoadModule rewrite_module libexec/httpd/mod_rewrite.so (Unix/Linux users should also see something like AddModule mod_rewrite.c) in your httpd.conf. Also make sure that those lines have not been commented out (by being prepended with a #). Restart Apache to make sure your conf settings are active.
- If you are installing CakePHP into a user directory (http://example.com/~username/cakephp/), or any other URL structure that already utilizes mod_rewrite, you'll need to add RewriteBase statements to the .htaccess files CakePHP uses (/.htaccess, /app/.htaccess, /app/webroot/.htaccess). The details of those changes will depend on your setup. Please refer to Apache's online documentation for more information.
Differences
| Lines: 1-16 | Lines: 1-17 | ||
| - | <title>Apache and mod_rewrite</title> | + | <title>Apache dan mod_rewrite</title> |
| <p> | <p> | ||
| - | While CakePHP is built to work with mod_rewrite out of the box–and usually does–we've noticed that a few users struggle with getting everything to play nicely on their systems. Here are a few things you might try to get it running correctly: | + | Sementara CakePHP ditulis untuk bekerja dengan mod_rewrite di luar kotak- dan biasanya tanpa masalah-kami mengetahui ada beberapa pengguna berjuang mendapatkan semua itu bekerja secara apik di sistem mereka. Inilah beberapa hal yang perlu Anda coba untuk mendapatkannya bekerja secara tepat: |
| </p> | </p> | ||
| <ul> | <ul> | ||
| - | <li>Make sure that an .htaccess override is allowed. In your httpd.conf, you should have a section that defines your Directory on the server. Make sure the AllowOverride is set to All for the correct DocumentRoot. | + | <li>Pastikan .htaccess override diperbolehkan. Dalam httpd.conf, Anda perlu memiliki bagian yang mendefinisikan Directory Anda pada server. Pastikan AllowOverride diset ke All untuk DocumentRoot yang sesuai. |
| </li> | </li> | ||
| - | <li>Make sure you are editing the system httpd.conf rather than a user- or site-specific httpd.conf. | + | <li>Pastikan Anda menyunting httpd.conf sistem, bukan httpf.conf user- atau site-tertentu. |
| </li> | </li> | ||
| - | <li>Is CakePHP missing its needed .htaccess files? This sometimes happens during copying or moving because some operating systems treat files that start with '.' as hidden. Make sure your copy of CakePHP is from the downloads section of the site or our SVN repository, and has been unpacked correctly. | + | <li>Apakah CakePHP tidak menemukan berkas .htaccess yang dibutuhkannya? Hal ini kadang terjadi saat menyalin atau memindahkan karena beberapa sistem operasi memperlakukan berkas dengan awalan '.' sebgai berkas tersembunyi. Pastikan salinan CakePHP Anda berasal dari bagian unduhan di situs atau repsitori SVN kami, dan telah di mekarkan secara benar. |
| </li> | </li> | ||
| - | <li>Make sure you are loading up mod_rewrite correctly. You should see something like <em>LoadModule rewrite_module libexec/httpd/mod_rewrite.so</em> (Unix/Linux users should also see something like <em>AddModule mod_rewrite.c</em>) in your httpd.conf. Also make sure that those lines have not been commented out (by being prepended with a #). Restart Apache to make sure your conf settings are active. | + | <li>Pastikan Anda memuat mod_rewrite secara benar. Anda akan mendapatkan sesuatu seperti <em>LoadModule rewrite_module libexec/httpd/mod_rewrite.so</em> (pengguna Linux/Unix perlu juga melihat sesuatu seperti <em>AddModule mod_rewrite.c</em>) dalam httpd.conf Anda. Juga pastikan tidak berupa komentar (dengan penambahan # di awal). Restart Apache untuk memastikan tata conf Anda aktif. </li> <li>Jika Anda menginstal CakePHP ke dalam direktori pengguna (http://example.com/~username), Anda perlu mengubah berkas .htaccess dalam base direktori tempat instalasi CakePHP Anda. Cukup tambahkan baris "RewriteBase /~myusername/". |
| </li> | </li> | ||
| - | <li>If you are installing CakePHP into a user directory (http://example.com/~username/cakephp/), or any other URL structure that already utilizes mod_rewrite, you'll need to add RewriteBase statements to the .htaccess files CakePHP uses (/.htaccess, /app/.htaccess, /app/webroot/.htaccess). The details of those changes will depend on your setup. Please refer to Apache's online documentation for more information.</li> | ||
| </ul> | </ul> | ||
