mod_rewrite is not being enabled?
Redirect
directive belongs to mod_alias
, not mod_rewrite
.
To test the mod_rewrite
, put the belows in .htaccess
file in document root:
RewriteEngine On
RewriteRule (.*) http://google.com [R=301,L]
Make sure that you set AllowOverride All
in <Directory "/document/root">
Related videos on Youtube
Lynob
Updated on September 18, 2022Comments
-
Lynob over 1 year
I have php 5.3.8, apache 2.2.21, all is good, except mod_rewrite
by default
LoadModule rewrite_module modules/mod_rewrite.so
is enabled (not commented out)ClearModuleList
does not existAddModule mod_rewrite.c
does not existand then you have
<Directory /> Options FollowSymLinks AllowOverride All </Directory>
still i test mod_rewrite and it's not working, what more should i do?? if it wasn't for .htaccess i would have used nginx, by the way apache was installed by default when i got the vps and then i updated it but that didn't change the httpd.conf settings
do you think i should uninstall it and reinstall it by myself??? everyone say that mod_rewrite should not be enabled by default so i don't know why my apache is different
-
user1233802 over 12 yearsThis question should be on serverfault.
-
Lynob over 12 years@RaffaelLuthiger then please migrate it because i don't want to ask it twice and then be told that this is a duplicated question, it happened before :D
-
Admin over 12 yearsdo you have any aliases? remove.
-
Admin over 12 yearshow did you test mod_rewrite? you need RewriteEngine On before RewriteRule in httpd.conf or .htaccess
-
Lynob over 12 years@mido i don't have aliases
-
Lynob over 12 years@cuttinger i tested my mod_rewrite like this Options +FollowSymLinks Redirect /google.html google.com
-
Lynob over 12 yearsi tested it using many ways, i get this error: the url requested was not found on the server
-
Lazy Badger over 12 yearsredirect and rewrite are different topics
-
user1233802 over 12 years@Eli I do not have enough points to migrate it myself. I can only flag the questions. And that's what I did. I left this note to those who can migrate.
-
-
Lazy Badger over 12 years302 responce, I suppose, is better in common
-
Lazy Badger over 12 yearsSmth. like
RewriteRule ^one.html$ two.html
is slightly better for local tests