View Full Version : Mod_Rewrite
kkellish
26th June 2006, 08:44 PM
How to I enable Mod_Rewrite on my plesk 8.0? I am trying to install a script and don't know if my mod_rewrite was on. Please help me
jamesyeeoc
27th June 2006, 02:34 AM
Check your httpd.conf file to see if mod_rewrite is available, on a RH type distro type this at the SSH shell prompt:grep 'rewrite' /etc/httpd/conf/httpd.confand you should see something like:
LoadModule rewrite_module modules/mod_rewrite.so
breun
27th June 2006, 05:23 AM
mod_rewrite is installed by default. Make sure to set 'RewriteEngine on' before your RewriteCond and RewriteRule statements.
chris.merrill
5th September 2006, 12:09 AM
I have seen a lot of discussion regarding mod_rewrite..
I am new to linux as I have previously only hosted on windows.
Is it posted somewhere, a simple how-to use mod_rewrite with plesk?
I am looking for simple things like:
domain.com/content/name = domain.com/content.php?content=name
pretty simple, right?
Any help would be greatly appreciated.
I used the above-mentioned grep command and got the posted result. That leads me to believe it is working fine.
breun
5th September 2006, 06:08 AM
There's nothing special about using mod_rewrite with Plesk. I usually refer to this mod_rewrite cheat sheet (http://www.ilovejackdaniels.com/apache/mod_rewrite-cheat-sheet/).
chris.merrill
5th September 2006, 10:38 AM
I assume that the rules should go into /var/www/vhosts/DOMAINNAME/conf ?
do i need to restart apache after changes?
breun
5th September 2006, 11:07 AM
If you put them in conf/vhost.conf you need to reload apache (and run websrvmng if you've just created vhost.conf of course). You can also just put your mod_rewrite rules in a .htaccess file. No need to reload anything then, although supposedly by using .htaccess you sacrifice some speed as apache needs to read .htaccess for each request.
chris.merrill
5th September 2006, 11:09 AM
so, when I use a .htaccess file, the syntax is the same?
breun
5th September 2006, 11:19 AM
Yes. Have you even looked for info yourself?
"This module operates on the full URLs (including the path-info part) both in per-server context (httpd.conf) and per-directory context (.htaccess) (...)"
http://httpd.apache.org/docs/2.0/mod/mod_rewrite.html
chris.merrill
5th September 2006, 11:47 AM
Thanks. This is my first time on linux/apache. I have hosted on IIS for about 5 years and finally made the switch.
I really appreciate the information you have provided. I definitely have enough to get going.
Thanks!!!:D
vBulletin® v3.6.12, Copyright ©2000-2008, Jelsoft Enterprises Ltd.