Results 1 to 10 of 10

Thread: mod_rewrite

  1. #1
    Roll Tide! mobilebadboy's Avatar
    Join Date
    Apr 2004
    Location
    Mobile, AL
    Posts
    428

    mod_rewrite

    Can anyone tell me why this isn't working?

    Code:
    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.
    Shawn Kerr .com

  2. #2
    Registered
    Join Date
    May 2003
    Location
    Southern California, USA
    Posts
    46
    try RewriteRule cat(.*)\.html$ index.php?cat=$1

  3. #3
    Roll Tide! mobilebadboy's Avatar
    Join Date
    Apr 2004
    Location
    Mobile, AL
    Posts
    428
    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.
    Shawn Kerr .com

  4. #4
    Web Monkey MarkB's Avatar
    Join Date
    Nov 2003
    Location
    London, UK
    Posts
    1,783
    How about:

    RewriteRule ^cat(.*).html$ index.php?cat=$1
    Stepping On Wires - the new blog

  5. #5
    Roll Tide! mobilebadboy's Avatar
    Join Date
    Apr 2004
    Location
    Mobile, AL
    Posts
    428
    Nope. I'm probably just doing something wrong somewhere. Ah well, I'll just leave it as is.
    Shawn Kerr .com

  6. #6
    Administrator Chris's Avatar
    Join Date
    Feb 2003
    Location
    East Lansing, MI USA
    Posts
    7,055
    You could use a ForceType directive instead.
    Chris Beasley - My Guide to Building a Successful Website[size=1]
    Content Sites: ABCDFGHIJKLMNOP|Forums: ABCD EF|Ecommerce: Swords Knives

  7. #7
    Web Monkey MarkB's Avatar
    Join Date
    Nov 2003
    Location
    London, UK
    Posts
    1,783
    Are you sure mod_rewrite is enabled on your server?
    Stepping On Wires - the new blog

  8. #8
    Roll Tide! mobilebadboy's Avatar
    Join Date
    Apr 2004
    Location
    Mobile, AL
    Posts
    428

    Re: mod_rewrite

    Originally posted by mobilebadboy
    I know mod_rewrite works, because I use it to redirect www.domain.com to domain.com.
    Shawn Kerr .com

  9. #9

    Re: mod_rewrite

    Try this:
    Code:
    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.

  10. #10
    Roll Tide! mobilebadboy's Avatar
    Join Date
    Apr 2004
    Location
    Mobile, AL
    Posts
    428
    Nope. I'm just meant to be search engine unfriendly.
    Shawn Kerr .com

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •