Need help installing PHP, configuring a script, or configuring a server? Then come on in and post your questions! We'll try to help the best we can !
Moderator: General Moderators
waradmin
Forum Contributor
Posts: 240 Joined: Fri Nov 04, 2005 2:57 pm
Post
by waradmin » Wed Mar 26, 2008 5:40 pm
I have the following htaccess file:
Code: Select all
Options +FollowSymLinks
RewriteEngine on
RewriteRule (.*)/(.*)/(.*)/(.*)/$ /index.php?$1=$2&$3=$4
Designed to take a URL like:
Code: Select all
http://www.mydomain.tld/index.php?page=members&do=inbox and make it like:
Code: Select all
http://www.mydomain.tld/page/members/do/inbox/
However it is just throwing me a 404 error. I am using Apache2Triad on a Windows development dummy server. Any ideas?
hawleyjr
BeerMod
Posts: 2170 Joined: Tue Jan 13, 2004 4:58 pm
Location: Jax FL & Spokane WA USA
Post
by hawleyjr » Wed Mar 26, 2008 5:45 pm
This is probably because you are using a Windows server.
Windows thinks that .htaccess is not a valid filename because it has no name, just an extension. There are work arounds for using windows and .htaccess try a search for "htaccess windows"
waradmin
Forum Contributor
Posts: 240 Joined: Fri Nov 04, 2005 2:57 pm
Post
by waradmin » Wed Mar 26, 2008 5:46 pm
In any rate, I get the same result on my Unix server.
waradmin
Forum Contributor
Posts: 240 Joined: Fri Nov 04, 2005 2:57 pm
Post
by waradmin » Wed Mar 26, 2008 6:00 pm
Update: I got it semi working. Is there a way to make the URL not require all the parts (note the updated htaccess looks like this):
Code: Select all
Options +FollowSymLinks
RewriteEngine on
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule (.*)/(.*)/(.*)/$ index.php?page=$1&$2=$3
For example, when I try to go to
http://www.example.tld/members/ I get a 404, however when I go to
http://www.example.tld/members/do/inbox/ it works (semi works, images are broken so I need to find a way to fix that too). Any ideas on this fix?