Results 1 to 10 of 10

Thread: Mod_Rewrite

  1. #1
    Join Date
    Aug 2005
    Posts
    454

    Mod_Rewrite

    I want to use mod_rewrite. when you go to domain.com/conact_us/contact/webmaster/ it is same as domain.com/conact_us.php?contact=webmaster. here is the code that I am using (got the code from http://www.webmaster-toolkit.com/mod...enerator.shtml):
    Code:
    Options +FollowSymLinks
    RewriteEngine on
    RewriteRule conact_us/(.*)/(.*)/$ /conact_us.php?$1=$2
    but I get this error:
    Code:
    Internal Server Error
    The server encountered an internal error or misconfiguration and was unable to complete your request.
    
    Please contact the server administrator, and inform them of the time the error occurred and anything you might have done that may have caused the error.
    
    More information about this error may be available in the server error log.
    
    Apache Server at localhost
    What is wrong?

  2. #2
    Join Date
    Jul 2003
    Location
    Kuwait
    Posts
    5,099
    Check your server logs first.
    In order to understand recursion, one must first understand recursion.
    If you feel like it, you can read my blog
    Signal > Noise

  3. #3
    Are you attempting to use mod_rewrite via .htaccess or httpd.conf?

  4. #4
    Join Date
    Jan 2002
    Location
    London UK
    Posts
    141
    Try:

    Options +FollowSymLinks
    RewriteEngine on
    RewriteRule ^conact_us/(.*)/(.*)/$ /conact_us.php?$1=$2


    Philco

  5. #5
    Join Date
    Mar 2004
    Location
    New Zealand
    Posts
    533
    Almost certainly Options +FollowSymLinks is not permitted by your server configuration.

  6. #6
    Join Date
    Aug 2005
    Posts
    454
    Originally posted by fyrestrtr
    Check your server logs first.
    [Wed Oct 26 07:12:28 2005] [error] [client 192.168.0.100] File does not exist: c:/webserver/www/conact_us/contact/webmaster/
    Originally posted by maxymizer
    Are you attempting to use mod_rewrite via .htaccess or httpd.conf?
    .htaccess

    Originally posted by Philco
    Options +FollowSymLinks
    RewriteEngine on
    RewriteRule ^conact_us/(.*)/(.*)/$ /conact_us.php?$1=$2
    Does not work, now I get a 404 error

    Originally posted by gogocode
    Almost certainly Options +FollowSymLinks is not permitted by your server configuration.
    How do I permitt it?

  7. #7
    Join Date
    Jul 2003
    Location
    Kuwait
    Posts
    5,099
    How do I permitt it?
    Make sure you are able to have rules in htaccess. Check AllowOverride settings.
    In order to understand recursion, one must first understand recursion.
    If you feel like it, you can read my blog
    Signal > Noise

  8. #8
    Join Date
    Aug 2005
    Posts
    454
    Originally posted by fyrestrtr
    Make sure you are able to have rules in htaccess. Check AllowOverride settings.
    This is what my http.config says:
    Code:
    #
    # This controls which options the .htaccess files in directories can
    # override. Can also be "All", or any combination of "Options", "FileInfo", 
    # "AuthConfig", and "Limit"
    #
        AllowOverride all

  9. #9
    Join Date
    Oct 2005
    Posts
    71
    Try this out:
    Code:
    Options +FollowSymLinks
    RewriteEngine on
    RewriteRule conact_us/([A-Za-z0-9]+)/(A-Za-z0-9]+)/?$ /conact_us.php?$1=$2
    hope that helps.. try it out..

    One more thing, did you know it says conact us, and not contact us?

  10. #10
    Join Date
    Aug 2005
    Posts
    454
    Quote Originally Posted by CoiL
    Try this out:
    Code:
    Options +FollowSymLinks
    RewriteEngine on
    RewriteRule conact_us/([A-Za-z0-9]+)/(A-Za-z0-9]+)/?$ /conact_us.php?$1=$2
    hope that helps.. try it out..

    One more thing, did you know it says conact us, and not contact us?
    Thanks, I will try it ASAP, also, you are right I did miss spell it.

Posting Permissions

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