mod_rewrite

comicway

Verified User
Joined
Jun 22, 2007
Messages
26
Hi,

i've got a problem with url rewriting, i've tried this in a .htaccess:
RewriteEngine on
RewriteRule ^([a-zA-Z]+)\.html$ index.php?page=$1 [L]

to modify url like www.mydomain.com/index.php?page=test
to www.mydomain.com/test.html

but this is not working,

i've check with phpinfo if the module mod_rewrite is present and activate and i've got this:
Code:
Loaded Modules 	core mod_access mod_auth mod_include mod_log_config mod_env mod_setenvif mod_ssl prefork http_core mod_mime mod_status mod_autoindex mod_asis mod_suexec mod_cgi mod_negotiation mod_dir mod_imap mod_actions mod_userdir mod_alias mod_rewrite mod_so sapi_apache2

but in my httpd.conf i didn't find any LoadModule with mod_rewrite.so
i've also searching in my server to mod_rewrite.so and i didn't find anything.

Can you help me?

cris
 
but in my httpd.conf i didn't find any LoadModule with mod_rewrite.so
i've also searching in my server to mod_rewrite.so and i didn't find anything.
Hello,
Could you post the result of teh following command:
Code:
grep mod_rewrite /etc/httpd/conf/httpd.conf
Also, what DA version are you using?
 
Hi,

Code:
box101:/# grep mod_rewrite /etc/httpd/conf/httpd.conf
box101:/#

DirectAdmin v1.30.2
 
I am really not sure why it's not there, but any way try the following:
1. Check that mod_rewrite module is available:
Code:
ls -la /etc/httpd/modules/mod_rewrite.so
2. Backup the current httpd.conf file, just in case:
Code:
mv -i /etc/httpd/conf/httpd.conf /etc/httpd/conf/httpd.conf-`date +%d-%b-%Y`
cp /etc/httpd/conf/httpd.conf-`date +%d-%b-%Y` /etc/httpd/conf/httpd.conf
3. Edit httpd.conf as follows:
a) add
LoadModule rewrite_module modules/mod_rewrite.so
after
LoadModule alias_module modules/mod_alias.so
b) add
AddModule mod_rewrite.c
after
AddModule mod_alias.c
c) Find the following line
<Directory /home/*>
and add
AllowOverride All

4. Restart Apache
Code:
service httpd restart

Let us know how it goes!

All the above assumes RH/Centos Linux and Apache 1.3.x
 
Code:
box101:/# ls -la /etc/httpd/modules/mod_rewrite.so
ls: /etc/httpd/modules/mod_rewrite.so: No such file or directory
Can you tell me where i can find mod_rewrite.so and mod_rewrite.c?

Thanks in advance
 
Code:
box101:/# ls -la /etc/httpd/modules/mod_rewrite.so
ls: /etc/httpd/modules/mod_rewrite.so: No such file or directory
Can you tell me where i can find mod_rewrite.so and mod_rewrite.c?

Thanks in advance

It looks like there is something wrong with your Apache installation.
mod_rewrite module should be built as part of Apache build made by DA.
 
i've only update apache to 2.0
how i can reinstall apache 2.0 with mod-rewrite

cris?
 
Back
Top