htaccess redirect + rewrite

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • Gozil
    New Member
    • Jul 2007
    • 42

    htaccess redirect + rewrite

    hello,
    I have been looking for a solution to redirect the users to the correct urlrewrite page but I cant come up with anything thats working.

    This is how I rewrite it now:[code=mod_rewrit e]
    RewriteRule ^(search)/(.*)$ search.php?id=$ 2 [L][/code]

    so basically the user could search like this:
    search/something

    the problem is that I need to redirect them from search.php?id=s omething to search/something

    I tried to add [R=301] but that didn't work, I didn't have any luck with redirect 301 either.

    Any ideas on how to get this fixed?
    Last edited by pbmods; Nov 16 '08, 04:44 PM. Reason: Added CODE tags.
  • pbmods
    Recognized Expert Expert
    • Apr 2007
    • 5821

    #2
    Heya, Gozil.

    Do a print_r($_SERVE R) for each URL and see which value you can use to find out which URL the User typed in.

    If I remember correctly, there are a couple of URL-related $_SERVER variables that mod_rewrite does not affect.

    Comment

    • Gozil
      New Member
      • Jul 2007
      • 42

      #3
      But isn't there a way to redirect them from the .htaccess file at once?

      Comment

      • Markus
        Recognized Expert Expert
        • Jun 2007
        • 6092

        #4
        Try changing the flag to [R], although I'm not understanding your problem fully.

        Comment

        Working...