Mod_Rewrite No Working. Help!!!

Discussion in 'PHP' started by richardandrews2007, Dec 23, 2007.

  1. #1
    Hi Experts,

    The Mod Rewrite on my server does't seem to be working. It is 1and1 hosting that I am using.

    I am not sure, what to do. I just know that there is sombody called htaccess which needs to be there in the server, and it is.

    When I spoke to 1and1 they gave me a link

    But I have no idea what this link says.
    Any, workaround possible?


    Thanks
     
    richardandrews2007, Dec 23, 2007 IP
  2. Vio82

    Vio82 Peon

    Messages:
    27
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #2
    Why you think that Mod Rewrite is not work?
    And tell more about the objective, what you wanna do?
     
    Vio82, Dec 23, 2007 IP
  3. ajsa52

    ajsa52 Well-Known Member

    Messages:
    3,426
    Likes Received:
    125
    Best Answers:
    0
    Trophy Points:
    160
    #3
    Are you getting a 500 HTTP error, or the commands used are not working ?
    BTW, if you want some help at least you should post ON THREAD:
    - What you want to do
    - The commands used on .htaccess file
    - The behaviour obtained
     
    ajsa52, Dec 23, 2007 IP
  4. richardandrews2007

    richardandrews2007 Active Member

    Messages:
    794
    Likes Received:
    2
    Best Answers:
    0
    Trophy Points:
    53
    #4
    Ok, it is a search engine script of the website i bought yesterday here on DP. I have changed all the config information as required. I have done all that was supposed to be done to me it run fine. Like Database Created, Config information changed. But at the end of it the site does't work. Have a Look and you would have an idea of what I am talking about. Site

    htaccess contents...
    RewriteEngine on
    RewriteRule ^([^-]+).css$ $1.css [L]
    RewriteRule ^([^-]+).js$ $1.js [L]
    RewriteRule ^([^-]+).xml$ $1.xml [L]
    RewriteRule ^([A-Z]|[a-z]|[0-9])/([^-]+)/?$ searchResult.php [L]
    RewriteRule ^([A-Z]|[a-z]|[0-9])([/])$ searchResult.php [L]
    RewriteRule [\/*?]([^-]+).html$ searchResult.php [L]
    RewriteRule ([^-]+).html$ searchResult.php [L]
    RewriteRule ^search.now$ searchResult.php [L]
    RewriteRule ^search.now?q=([^-]+)$ search.php?q=$2 [L]

    Anything can be done now?
     
    richardandrews2007, Dec 23, 2007 IP
  5. ajsa52

    ajsa52 Well-Known Member

    Messages:
    3,426
    Likes Received:
    125
    Best Answers:
    0
    Trophy Points:
    160
    #5
    The file looks fine for me, so I only can give you a couple of tips:
    - Try with file saved in UNIX mode (Line Feed only, instead of Carrier Return + Line Feed DOS mode)
    - Save the file with rule 1 and test that rule, then add rule 2 and test rules 1 and 2, and so on.
     
    ajsa52, Dec 23, 2007 IP
  6. Vio82

    Vio82 Peon

    Messages:
    27
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #6
    Be sure that file named ".htaccess" with dot at start and look at your error.log file it may help you.
     
    Vio82, Dec 23, 2007 IP