PDA

View Full Version : mod_rewrite



mobilebadboy
04-16-2004, 10:14 AM
Can anyone tell me why this isn't working?



Options +FollowSymLinks
RewriteEngine on
RewriteBase /
RewriteRule cat(.*)\.html$ /index\.php?cat=$1
I'm trying to change any index.php?cat=XXX URLs to catXXX.html. I know mod_rewrite works, because I use it to redirect www.domain.com to domain.com.

johnn
04-16-2004, 11:16 AM
try RewriteRule cat(.*)\.html$ index.php?cat=$1

mobilebadboy
04-16-2004, 11:28 AM
That didn't do anything either. Nothing I've tried has caused any problems, just nothing is working period. It's like it's just ignoring the rule.

MarkB
04-16-2004, 02:09 PM
How about:

RewriteRule ^cat(.*).html$ index.php?cat=$1

mobilebadboy
04-16-2004, 02:17 PM
Nope. I'm probably just doing something wrong somewhere. Ah well, I'll just leave it as is.

Chris
04-16-2004, 05:54 PM
You could use a ForceType directive instead.

MarkB
04-16-2004, 11:42 PM
Are you sure mod_rewrite is enabled on your server?

mobilebadboy
04-17-2004, 12:09 AM
Originally posted by mobilebadboy
I know mod_rewrite works, because I use it to redirect www.domain.com to domain.com. ;)

freekrai
04-17-2004, 07:58 AM
Try this:


RewriteEngine on
RewriteRule ^cat(.*).html?$ index.php?cat=$1 [QSA,L]


Try it without the FollowSymLinks options first, then go back and try it with the SymLinks options turned on.

mobilebadboy
04-17-2004, 11:13 AM
Nope. I'm just meant to be search engine unfriendly.