PDA

View Full Version : Need help setting up the .htaccess


Keleth
06-11-2009, 11:37 PM
This is my current .htaccess

ErrorDocument 403 errors/403.php
ErrorDocument 404 errors/404.php

Options -Indexes +FollowSymLinks
RewriteEngine On

RewriteCond %{REQUEST_URI} ^/$
RewriteRule !\.(css|jpg|js|gif)$ blog/index.php

RewriteCond %{REQUEST_URI} !^.*/serverReturns/.*\.php$
RewriteCond %{REQUEST_URI} !^.*/blog/.*$
RewriteCond %{REQUEST_URI} !^.*/test.php$
RewriteCond %{REQUEST_URI} !^.*/dbBackup.php$
RewriteRule !\.(css|jpg|js|gif)$ dispatch.php

My problem is this:

What I'd like is I'd like it so when someone visits the home page, it instead goes to blog/index.php, and so that it continues to work as Wordpress expects, that's why the second rule blocks out /blog/.

But if the page is anything else, I'd like the second rule to work. I'm just confused on why this doesn't work.

Also, anyone know if there's some way to figure out what %{REQUEST_URI} sees? So I can figure out my conditions?

Its worth noting, my home page is http://localhost/Mafia v2

schleppel
06-17-2009, 12:18 AM
Try
ErrorDocument 403 errors/403.php
ErrorDocument 404 errors/404.php

Options +FollowSymLinks -Indexes

RewriteEngine On

RewriteRule ^$ ./blog/index.php [QSA,L]

RewriteCond %{REQUEST_URI} !^/serverReturns/.+\.php$
RewriteCond %{REQUEST_URI} !^/blog/.*$
RewriteCond %{REQUEST_URI} !^/(dbBackup|test)\.php$
RewriteCond %{REQUEST_URI} !^/dbBackup.php$
RewriteRule !\.(css|jpg|js|gif)$ ./dispatch.php [QSA,L]