Page 1 of 1

Redirect Problem (Triggering 404)

Posted: Thu Oct 27, 2011 3:43 pm
by Trahb
I'm brain-dead right now. I've been staring at my computer for an hour+, and just can't seem to figure out what's going wrong.
I need an extremely light framework to house a personal project I'm working on, and decided making the simplest possible myself would be the best option.
So, as I've been told in numerous tutorials, I need to redirect ever page request to my index.php file. That makes perfect sense. What doesn't make sense is why the .htaccess content I've seen a myriad of times across the Internet won't work for me.

Here's what I've got in my .htaccess file

Code: Select all

RewriteEngine On

RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME} !-f

RewriteRule ^(.*)$ index.php?c=$1 [QSA]
Three things to note:
1.) localhost/asdf takes me to localhost/index.php?c=asdf (it's doing exactly what I want here)
2.) localhost/asdf/ghjk results in a 404 error
3.) [QSA, L] at the end of index.php?c=$1 results in a 500 error

If anyone has any sort of explanation as to what I've done wrong, or suggestions on what to try, they'd be much appreciated.

Thanks for your time

Re: Redirect Problem (Triggering 404)

Posted: Thu Oct 27, 2011 3:50 pm
by Celauran
Here's my .htaccess

Code: Select all

# Turn on URL rewriting
RewriteEngine On

# Installation directory
RewriteBase /

# Protect hidden files from being viewed
<Files .*>
	Order Deny,Allow
	Deny From All
</Files>

# Protect application and system files from being viewed
RewriteRule ^(?:application|modules|system)\b.* index.php/$0 [L]

# Allow any files or directories that exist to be displayed directly
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d

# Rewrite all other URLs to index.php/URL
RewriteRule .* index.php/$0 [PT]

Re: Redirect Problem (Triggering 404)

Posted: Thu Oct 27, 2011 4:12 pm
by Trahb
Thanks for that faaast reply, but even using parts of that I get Error 404 when I try localhost/asdf/jkl