|
Home > Archive > Apache Server configuration support > February 2006 > can't get mod_rewrite working
You are viewing an archived Text-only version of the thread.
To view this thread in it's original format and/or if you want to reply to
this thread please [click here]
| Author |
can't get mod_rewrite working
|
|
| lostnspaced 2006-02-02, 8:06 am |
| Hi All
have installed apache and mod_rewrite was statically loaded
/httpd -l gives me
[code]
http_core.c
mod_env.c
mod_log_config.c
mod_mime.c
mod_negotiation.c
mod_status.c
mod_include.c
mod_autoindex.c
mod_dir.c
mod_cgi.c
mod_asis.c
mod_imap.c
mod_actions.c
mod_userdir.c
mod_alias.c
mod_rewrite.c
mod_access.c
mod_auth.c
mod_so.c
mod_setenvif.c
mod_php4.c
mod_perl.c
mod_jk.c
[/code]
So mod_rewrite is now installed. (Thank goodness)
However switching it on is proving difficult.
In httpd.conf i have
[code]
<Directory />
Options FollowSymLinks
AllowOverride All
</Directory>
<IfModule mod_rewrite.c>
RewriteEngine On
</IfModule>
[/code]
What could be wrong?
LoadModule or AddModule not required as it has already been statically
loaded
I did a test like this
<h2>This is an html file</h2> saved as index.html
<h2>This is a php file</h2> saved as index.php
and created a .htaccess file with
[code]
RewriteEngine On
RewriteRule ^test\.html$ test.php [L]
[/code]
then navigated to machine/index.html
If mod_rewrite was working then it should display the php file however
it just displays the html file.
So rewrite is not on.
Any suggestions?
| |
| Me, Myself, and I 2006-02-02, 6:02 pm |
| I managed to get mine working as:
RewriteRule ^/test.html$ /test.php
| RewriteEngine On
| RewriteRule ^test\.html$ test.php [L]
| [/code]
| Any suggestions?
|
| |
| Robert Ionescu 2006-02-02, 6:02 pm |
| lostnspaced wrote:
> In httpd.conf i have
Well, if you do have access to httpd.conf, there is no need to use
..htacess files. The performance in httpd.conf (per-server context) is
much better.
RewriteEngine On
RewriteRule ^/test\.html$ /test.php [L]
(httpd.conf, main server configuration or inside <virtualhost...>
BTW: You edited the wrong <directory...>-container, this is (and should
be) a restrictive one). You should edit the directory for your htdocs
instead.
--
Robert
| |
| lostnspaced 2006-02-03, 7:49 am |
| Cheers,
Yeah, that was the trouble.
The directory for htdocs.
All working now.
Thankyou
|
|
|
|
|