Revision history for ModrewriteInSubdirectoryWorkaround


Revision [18707]

Last edited on 2008-01-28 00:12:31 by CyneBeald [Modified links pointing to docs server]

No Differences

Revision [12308]

Edited on 2005-12-17 01:25:20 by CyneBeald [Clarified the examples given, the ones presented seemed to be exactly the case when the workaround *]
Additions:
The installation path of Wikka (relative to the document root) is different from the path used to acess Wikka in the URL. Some examples might be:
Installation directory ##/www/wiki## acessed via http://www.example.com/wiki/
Installation directory ##/wiki## acessed via http://wiki.example.com/
Use the **##""RewriteBase""##** directive to tell Apache what the **URL** is for the directory Wikka is installled in. If, for example, Wikka is installed in the directory ##**/www/wiki**## but it is acessed using ""http://www.example.com""**/wiki**, you need to modify the **.htacess** file in the ##**/www/wiki**## directory (starting with line 7):
%%and add a ##""RewriteBase""## directive with the **/wiki** part of the URL:
Deletions:
Wikka is installed in a subdirectory - like http://example.com/wiki/ - and rewriting as defined in .htaccess doesn't work: the paths aren't correct.
Use the **##""RewriteBase""##** directive to tell Apache what the URL is for the directory the .htaccess file is in. So for the **.htaccess file in the ##wiki## subdirectory** which has (starting with line 7):
%%a ##""RewriteBase""## directive needs to be added:


Revision [6833]

Edited on 2005-03-22 06:57:44 by JavaWoman [adding link]
Additions:
>>See also: ModRewrite>>===Symptoms===
Deletions:
===Symptoms===


Revision [6060]

Edited on 2005-02-16 22:19:29 by JavaWoman [added note to httpd.confs solution + removed line #s for that]
Additions:
If you would rather add it to your Apache configuration file (httpd.conf), instead of .htaccess, you need to enclose it in a <Directory> and not use the ##""RewriteBase""## directive:
%%(xml)<Directory /usr/local/www/data/wiki>
%% where the path /usr/local/www/data/wiki corresponds to the absolute server path where your Wikka is installed (change to match your configuration).
Deletions:
%%If you would rather add it to your Apache configuration file (httpd.conf), instead of .htaccess, you need to enclose it in a <Directory> and not use the ##""RewriteBase""## directive:
%%(xml;7)<Directory /usr/local/www/data/wiki>


Revision [6003]

Edited on 2005-02-15 13:17:09 by DarTar [minor]
Additions:
Use the **##""RewriteBase""##** directive to tell Apache what the URL is for the directory the .htaccess file is in. So for the **.htaccess file in the ##wiki## subdirectory** which has (starting with line 7):
%%a ##""RewriteBase""## directive needs to be added:
%%If you would rather add it to your Apache configuration file (httpd.conf), instead of .htaccess, you need to enclose it in a <Directory> and not use the ##""RewriteBase""## directive:
Deletions:
Use the ""**##RewriteBase##**"" directive to tell Apache what the URL is for the directory the .htaccess file is in. So for the **.htaccess file in the ##wiki## subdirectory** which has (starting with line 7):
%%a ""##RewriteBase##"" directive needs to be added:
%%If you would rather add it to your Apache configuration file (httpd.conf), instead of .htaccess, you need to enclose it in a <Directory> and not use the RewriteBase directive:


Revision [6002]

Edited on 2005-02-15 13:06:49 by BarkerJr [Added httpd.conf information]
Additions:
%%If you would rather add it to your Apache configuration file (httpd.conf), instead of .htaccess, you need to enclose it in a <Directory> and not use the RewriteBase directive:
%%(xml;7)<Directory /usr/local/www/data/wiki>
RewriteEngine on
RewriteCond %{REQUEST_FILENAME} -d
RewriteRule ^(.*/[^\./]*[^/])$ $1/
RewriteRule ^(.*)$ wikka.php?wakka=$1 [QSA,L]
</Directory>


Revision [5981]

Edited on 2005-02-15 07:29:16 by JavaWoman [minor]
Additions:
=====Mod_rewrite with Wikka in subdirectory doesn't work=====
Wikka is installed in a subdirectory - like http://example.com/wiki/ - and rewriting as defined in .htaccess doesn't work: the paths aren't correct.
Deletions:
=====Mod_rewrite with Wikka installed in subdirectory=====
Wikka is installed in a subdirectory - like http://example.com/wiki/ - and rewriting as defined in .htaccess doesn't work.


Revision [5980]

Edited on 2005-02-15 07:27:41 by JavaWoman [initial]
Additions:
=====Mod_rewrite with Wikka installed in subdirectory=====

===Symptoms===
Wikka is installed in a subdirectory - like http://example.com/wiki/ - and rewriting as defined in .htaccess doesn't work.

===Cause===
If the path to the subdirectory is the same as the document root plus the subdirectory, the translation should work fine. However, if some kind of aliasing is taking place (as may be the case with hosted sites, though that is not the only possibility) then Apache won't be able to construct the correct URL without a little help.

===Applies to===
All Wikka versions
==Note==
Future versions of Wikka (> 1.1.6.0) may handle the workaround outlined below automatically.

===Solution===
Use the ""**##RewriteBase##**"" directive to tell Apache what the URL is for the directory the .htaccess file is in. So for the **.htaccess file in the ##wiki## subdirectory** which has (starting with line 7):
%%(xml;7)<IfModule mod_rewrite.c>
RewriteEngine on
RewriteCond %{REQUEST_FILENAME} -d
RewriteRule ^(.*/[^\./]*[^/])$ $1/
RewriteRule ^(.*)$ wikka.php?wakka=$1 [QSA,L]
</IfModule>
%%a ""##RewriteBase##"" directive needs to be added:
%%(xml;7)<IfModule mod_rewrite.c>
RewriteEngine on
RewriteBase /wiki
RewriteCond %{REQUEST_FILENAME} -d
RewriteRule ^(.*/[^\./]*[^/])$ $1/
RewriteRule ^(.*)$ wikka.php?wakka=$1 [QSA,L]
</IfModule>
%%


----
Deletions:
=====Problem description=====

//This page is a **template** intended for documentation of **workarounds** for unusual Wikka problems. This page belongs to CategoryTemplate (which contains more handy templates). To create a Wikka **workaround** page, [[http://wikka.jsnx.com/WorkaroundTemplate/clone clone this page]] (most workaround page names end in 'Workaround' so it's useful to stick to that convention) and replace the title with a problem description (in a few words). Then remove this paragraph and provide actual page content in the outline below.//
===Symptoms===

===Cause===

===Applies to===

===Solution===

----


Revision [5979]

The oldest known version of this page was created on 2005-02-15 07:04:38 by JavaWoman [initial]
Valid XHTML :: Valid CSS: :: Powered by WikkaWiki