How to check/enable mod_rewrite on Apache/Linux
13,714
mod_rewrite is already included in the httpd
package, and is loaded in the default configuration. Use the RewriteEngine
directive to enable it as required.
Related videos on Youtube
Author by
Yarin
Updated on September 17, 2022Comments
-
Yarin almost 2 years
I can't get wordpress permalinks working on my Fedora LAMP server and expect it's due to mod_rewrite issue, but I can't figure out
- How do I check if mod_rewrite exists/is enabled?
- How do I install it (yum?) if it's not?
Any help appreciated. Thanks-
-
stew over 13 yearsdoes "apachectl -l" list mod_rewrite.c ? if so, it was compiled in.
-
Yarin over 13 years@stew- no it doesn't. All it lists are core.c, prefork.c, http_core.c, and mod_so.c. So does that mean I have to recompile? That scares me- is there another way?
-
stew over 13 yearsno, it still can be added as a module, this just means it wasn't compiled in directly
-
stew over 13 yearsthat would help with debian (and ubuntu and other derivatives) but not likely on fedora
-
Ignacio Vazquez-Abrams over 13 yearsThe best thing to do is to check the Context tag in the documentation. That will tell you where the directive can be used. httpd.apache.org/docs/2.2/mod/mod_rewrite.html#rewriteengine
-
Yarin over 13 years@DerfK- It's fedora, and "LoadModule rewrite_module modules/mod_rewrite.so" already exists...
-
Yarin over 13 yearsLooks like mod_rewrite was indeed enabled, and I didn't need theRewriteEngine directive- Thanks for the help though-