
|
[dokuwiki]
||
[Date Prev]
[09-2007 Date Index]
[Date Next]
||
[Thread Prev]
[09-2007 Thread Index]
[Thread Next]
[dokuwiki] Re: dokuwiki htaccess rules in conflict with other domain rewrites?
- From: Markus Frosch <markus@xxxxxxxxxxxxx>
- To: dokuwiki@xxxxxxxxxxxxx
- Date: Thu, 06 Sep 2007 21:18:29 +0200
Hello Ryan,
I'm not sure what your problem is with this rewrite issue...
It's just logical to replace any parent rewrite rules if local rules are
existing. Just imaging what happens if Apache "merges" these rules. It
would end up in a chaotic configuration...
You should be able to solve the problem by adding the following as one
of the first rules to Dokuwiki's .htaccess:
RewriteCond %{HTTP_HOST} !^mydomain.com$ [NC]
RewriteRule ^/dokuwiki(.*)$ http://mydomain.com/dokuwiki$1 [L,R=301]
What do you think? :-)
Markus Frosch
Ryan Jacobs schrieb:
> Hello!
>
> I really hope this is an appropriate place to ask this question, as I
> think it might be more apache rewrite-specific that dokuwiki-specific,
> but I'm just not sure, and am hoping someone out there may shed some
> light on things. I've scoured Google, but have only found a couple cases
> of similar problems, but no actual solutions...
>
> Basically I have a dokuwiki install rooted in a subdirectory of my
> domain (http://mydomain.com/dokuwiki), all of which is hosted on a
> shared commercial host (not my own server). I have URL rewriting setup
> using an .htaccess file in my /dokuwiki folder and the standard rewrite
> rules for a dokuwiki install (found at
> http://wiki.splitbrain.org/wiki:rewrite and using "RewriteBase /dokuwiki").
>
> My problem arises when I try to setup some other domain-wide rewrite
> rules in another .htaccess file at the root of the domain
> (http://mydomain.com/). These new rules function for any directory in my
> domain EXCEPT my dokuwiki installation at /dokuwiki. For example I use
> the following in the domain root .htaccess to remove the www from all
> domain requests:
>
> RewriteEngine On
> RewriteBase /
> RewriteCond %{HTTP_HOST} !^mydomain.com$ [NC]
> RewriteRule ^(.*)$ http://mydomain.com/$1 [L,R=301]
>
> A request to http://www.mydoman.com/somefolder/ redirects to
> http://mydoman.com/somefolder/, but http://www.mydoman.com/dokuwiki/
> DOES NOT redirect. However if I turn off Dokuwiki rewriting and remove
> my /dokuwiki/.htaccess file, then http://www.mydoman.com/dokuwiki/ DOES
> redirect to the non-www version.
>
> I read that apache has to do some tricky things to manage paths when
> processing per-directory .htaccess rules (hence the RewriteBase), so
> maybe there is some conflict here? Or perhaps there is something in the
> default Dokuwiki .htaccess rules that somehow conflicts with .htaccess
> rules higher up in the tree (though I didn't think that was possible)?
>
> Sorry again if this is very apache specific, but I have to start
> somewhere, and am perhaps a bit over my head at the moment.
>
> Thanks and cheers,
> Ryan
>
Gruß
Markus Frosch
--
markus@xxxxxxxxxxxxx
http://www.lazyfrosch.de
|

|