Jump to content

Topic on Extension talk:Simple Farm/Flow

Lieutenant S. Reznov (talkcontribs)

The extension page lists this as the content for .htaccess

# (c) 2011-2012 by Stephan Jauernick (http://stejau.org)
# Distributed under ISC license
RewriteEngine on
 
# crazy magic:
# this piece checks if we have mess with wiki stuff
RewriteCond %{REQUEST_FILENAME} wiki$
# next rule sets a env var to a value which can be used to check if files are in shared code base
RewriteRule ^/?wiki/(.*)$ - [E=REQUEST_FILENAME_W:%{DOCUMENT_ROOT}/w/$1]
# check if file is existent in shared code base
RewriteCond %{ENV:REQUEST_FILENAME_W} -d [OR]
RewriteCond %{ENV:REQUEST_FILENAME_W} -f
# if so: rewrite
RewriteRule ^/?wiki/(.*)$ /w/$1 [PT,L,QSA]
 
# standard rewrite magic:
RewriteRule ^/?wiki/[Ii]ndex\.php/(.*)$ /w/index.php?title=$1 [PT,L,QSA,B]
RewriteRule ^/?wiki/(.*)$ /w/index.php?title=$1 [PT,L,QSA,B]
RewriteRule ^/?wiki$ /w/index.php [PT,L,QSA,B]
RewriteRule ^/?images/(.*)$ /w/images/$1 [PT,L,QSA,B]
RewriteRule ^wiki/images/(.*)$ /w/images/$1 [PT,L,QSA,B]
RewriteCond %{REQUEST_URI} ^/$
RewriteRule ^/?$ /w/index.php

And I have the domain.tld/pagename setup. (yourwiki.mywiki.ssu.lt)

I changed it to this but it doesn't work.

# (c) 2011-2012 by Stephan Jauernick (http://stejau.org)
# Distributed under ISC license
RewriteEngine on

# crazy magic:
# this piece checks if we have mess with wiki stuff
RewriteCond %{REQUEST_FILENAME} wiki$
# next rule sets a env var to a value which can be used to check if files are in shared code base
RewriteRule ^/?(.*)$ - [E=REQUEST_FILENAME_W:%{DOCUMENT_ROOT}/$1]
# check if file is existent in shared code base
RewriteCond %{ENV:REQUEST_FILENAME_W} -d [OR]
RewriteCond %{ENV:REQUEST_FILENAME_W} -f
# if so: rewrite
RewriteRule ^/?(.*)$ /$1 [PT,L,QSA]

# standard rewrite magic:
RewriteRule ^/?[Ii]ndex\.php/(.*)$ /index.php?title=$1 [PT,L,QSA,B]
RewriteRule ^/?(.*)$ /index.php?title=$1 [PT,L,QSA,B]
RewriteRule ^/?$ /index.php [PT,L,QSA,B]
RewriteRule ^/?images/(.*)$ /images/$1 [PT,L,QSA,B]
RewriteRule ^wiki/images/(.*)$ /images/$1 [PT,L,QSA,B]
RewriteCond %{REQUEST_URI} ^/$
RewriteRule ^/?$ /index.php

Do you know what I should change it to?

This post was posted by Lieutenant S. Reznov, but signed as Inquisitor Ehrenstein.

Danwe (talkcontribs)

This looks like you don't want the /wiki/ or /w/ part in your urls, is that right? I don't quite remember why it is or where I read it, but I remember that it is being discouraged from doing so in general, I tried it a few years ago and remember switching back to the old scheme because it wouldn't work well.

Reply to "Modifying .htaccess"