rewrite directory friendly urls, but failed, 404 error

Discuss practical ways rearrange URLs using mod_rewrite.

rewrite directory friendly urls, but failed, 404 error

Postby hilen wu » Mon Jun 30, 2008 11:25 pm

I want to rewrite
/cat80
to
/index.php?catid=80
Here is my rules in my .htaccess file.

Options Indexes FollowSymLinks
RewriteEngine On
RewriteBase /
RewriteRule ^cat(.+)$ index.php?catid=$1 [L]

I checked many and many times, but can't figure out, it continue sas "404 erro, pagecn't can't been found"

I looks like it doesn't support directory rewrite,
I can access index.php
so I tested with a rule
RewriteRule ^home$ index.php [L]
it can't work either when I try to enter /home to access /index.php
but if I write
RewriteRule ^home/$ index.php [L]
it works file, I can access /index.php using /home/

Anybody can help me out one this problem, I have read hundreds of document try to figure out it, but failed.
hilen wu
 
Posts: 2
Joined: Mon Jun 30, 2008 11:12 pm

Postby richardk » Tue Jul 01, 2008 3:52 pm

Try
Code: Select all
Options Indexes FollowSymLinks
Options -MultiViews

RewriteEngine On

RewriteRule ^cat([0-9]+)$ /index.php?catid=$1 [L]
richardk
 
Posts: 8800
Joined: Wed Dec 21, 2005 7:50 am

Still can't work

Postby hilen wu » Fri Jul 04, 2008 11:31 pm

it seems there are something wrong with the Godaddy host, as I can make it work in my local computer.
hilen wu
 
Posts: 2
Joined: Mon Jun 30, 2008 11:12 pm


Return to Friendly URLs with Mod_Rewrite

Who is online

Users browsing this forum: No registered users and 97 guests

cron