1. Advertising
    y u no do it?

    Advertising (learn more)

    Advertise virtually anything here, with CPM banner ads, CPM email ads and CPC contextual links. You can target relevant areas of the site and show ads based on geographical location of the user if you wish.

    Starts at just $1 per CPM or $0.10 per CPC.

problem with .htaccess...

Discussion in 'Apache' started by collinm, Oct 20, 2005.

  1. #1
    hi

    i try to to do overriding with apache

    in my loadmodule.conf
    
    LoadModule rewrite_module /usr/lib/apache2-prefork/mod_rewrite.so
    
    Code (markup):
    in httpd.conf

    
    <Directory />
     Options None
     AllowOverride All
     Order deny,allow
     Deny from all
    </Directory>
    
    # use .htaccess files for overriding,
    AccessFileName .htaccess
    # and never show them
    <Files ~ "^\.ht">
     Order allow,deny
     Deny from all
    </Files>
    
    Code (markup):
    my .htaccess file
    
    Options +FollowSymlinks
    RewriteEngine on
    ErrorDocument 404 /index
    
    RewriteRule ^news([0-9]+)$ newssection.php?sec_nosection=$1 [L]
    RewriteRule ^index$ index.php [L]
    
    Code (markup):
    if i go to:
    http://localhost/newssection.php?sec_nosection=1
    that work fine...

    but if i try

    ttp://localhost/news1

    i get:

    
    Object not found!
     The requested URL was not found on this server. The link on the referring page seems to be wrong or outdated. Please inform the author of that page about the error. 
     If you think this is a server error, please contact the webmaster. 
    Error 404
    
    Code (markup):


    error_log file
    
    [Thu Oct 20 12:33:30 2005] [warn] Init: Session Cache is not configured [hint: SSLSessionCache]
    [Thu Oct 20 12:33:30 2005] [notice] suEXEC mechanism enabled (wrapper: /usr/sbin/suexec2)
    [Thu Oct 20 12:33:31 2005] [notice] Apache/2.0.54 (Linux/SUSE) configured -- resuming normal operations
    [Thu Oct 20 12:33:48 2005] [error] [client 127.0.0.1] File does not exist: /srv/www/htdocs/favicon.ico
    [Thu Oct 20 12:33:49 2005] [error] [client 127.0.0.1] File does not exist: /srv/www/htdocs/news2, referer: http://localhost/
    
    Code (markup):
    any idea?
     
    collinm, Oct 20, 2005 IP
  2. johnt

    johnt Peon

    Messages:
    178
    Likes Received:
    21
    Best Answers:
    0
    Trophy Points:
    0
    #2
    Looks fine to me.

    Is your .htaccess file in /srv/www/htdocs ?
     
    johnt, Oct 20, 2005 IP
  3. collinm

    collinm Peon

    Messages:
    2
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #3
    ls -ls /srv/www/htdocs/.htaccess
    4 -rw-r--r-- 1 collinm users 3445 2005-10-18 23:28 /srv/www/htdocs/.htaccess
     
    collinm, Oct 20, 2005 IP
  4. johnt

    johnt Peon

    Messages:
    178
    Likes Received:
    21
    Best Answers:
    0
    Trophy Points:
    0
    #4
    Try adding
    RewriteBase /
    Code (markup):
    before your RewriteRules. That should sort it out.
     
    johnt, Oct 21, 2005 IP