Member Avatar

Hi all,

I'm having some issues with RewriteRules conflicting in my .htacccess file. For starters, here's the file:

<IfModule mod_rewrite.c>
Options -MultiViews
RewriteEngine On

#Start forum rules
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule \.(jpeg|jpg|gif|png)$ /public/404.php [NC,L]

RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /index.php [L]

#Start wiki rules
RewriteRule ^/?wiki(/.*)?$ %{DOCUMENT_ROOT}/w/index.php [L]
RewriteRule ^/?$ %{DOCUMENT_ROOT}/w/index.php [L]

RewriteRule ^/?w/images/thumb/[0-9a-f]/[0-9a-f][0-9a-f]/([^/]+)/([0-9]+)px-.*$ %{DOCUMENT_ROOT}/w/thumb.php?f=$1&width=$2 [L,QSA,B]

RewriteRule ^/?w/images/thumb/archive/[0-9a-f]/[0-9a-f][0-9a-f]/([^/]+)/([0-9]+)px-.*$ %{DOCUMENT_ROOT}/w/thumb.php?f=$1&width=$2&archived=1 [L,QSA,B]

I'm running a forum (IPBoard) and a wiki (Mediawiki) and both have basically the same goals. The forum uses friendly URLs by removing index.php to make and the wiki uses a rewrite to turn into

The rules seem to be conflicting in their current state, however. Most of my experience lies with IIS on windows, so .htaccess is a bit new to me. All of these directives are copied from the respective applications. Thanks for your help.

Member Avatar

I was able to fix the issue on my own after a little research and creative (to me) thinking.

I added RewriteCond %{REQUEST_URI} !^/wiki to the forum rules, so they won't be applied if the url contains /wiki.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, learning, and sharing knowledge.