Revision [7615]
This is an old revision of ModRewrite made by JavaWoman on 2005-04-26 10:21:48.
Wikka and mod_rewrite
The Apache webserver has a module called mod_rewrite; mod_rewrite "rewrites" URLs so it can do things like translate the URL http://wikka.jsnx.com/DotMG into http://wikka.jsnx.com/wikka.php?wakka=DotMG. This gives us nice, short, and user-friendly URLs to use with Wikka while internally Wikka works with the "full" URL.
Wikka works with mod_rewrite. And Wikka works without mod_rewrite.
Requirements
- The major requirement is that Wikka is installed on a system with Apache as the web server. (Some other web servers, like lighttpd, support similar functionality, but go.microsoft.com/fwlink/?LinkId=7001 IIS definitely does not.)
- Also, mod_rewrite must be enabled (not the case with with all hosted Apache systems)
- Finally, either .htaccess configuration must be allowed (not the case on many hosted systems) - because Wikka by default uses .htaccess files in directories to enable/disable URL rewiting - or you must have root access and be able to edit the Apache configuration (httpd.conf) directly (only on dedicated servers or some virtual private/dedicated systems).
Configuration
During installation, Wikka will try to figure out if mod_rewrite is available. If Wikka does not detect mod_rewrite, it's possible to manually configure Wikka to use it after installation.Follow this simple instruction:
- Edit wikka.config.php (found in the root directory of the Wikka installation).
Change these lines:
"base_url" => "http://my.domain.com/wikka.php?wakka=",
"rewrite_mode" => "0",
"rewrite_mode" => "0",
to this:
"base_url" => "http://my.domain.com/",
"rewrite_mode" => "1",
"rewrite_mode" => "1",
Even if URL rewriting is used in Wikka, the long form of the URLs will continue working so you don't need to change any links with long URLs you may already have when switching to using mod_rewrite.
Troubleshooting
If after following the instruction above mod_rewrite is still not working, first make sure that Wikka is actually running on Apache. Creating a page with just and calling this page up in the browser will give a host of information about the environment PHP is running in.If it is Apache, there are two possibile causes why mod_rewrite may not work: Either your web host does not have mod_rewrite configured so that you can use it, or .htaccess is ignored in directories. (You may try asking your host to enable both - if that doesn't work you'll have to do with long URLs.)
Known issues
Some Apache versions for Windows have a bug that will lowercase all URLs when using mod_rewrite; this is a ModRewriteDevelopment problem in Wikka specifically when creating new pages. We're looking into the possibility of creating a workaround for this.CategoryDocumentation