Menu

Using mod rewrite

Help
2004-10-08
2013-04-15
  • Nobody/Anonymous

    Hi,
    I am using webserv and i can't seem to make mod rewrite work. I have uncommented the module in Php.ini but it still don't seems to work.

    Any help will be appreciated.

    Thanks and regards
    ac_sandeep@hotmail.com

     
    • Nobody/Anonymous

      what about in httpd.conf
      \webserv\apache2\conf

       
    • Nobody/Anonymous

      sorry about that. When i said php.ini i meant httpd.conf.

      Earlier i had phpdev and it worked fine. Now i have installed webserv but now mod-rewrite is not working :-(

      Regards

       
    • Nobody/Anonymous

      make sure all the files from phpdev are removed from the  windows directory

      what error do you get when you run apache -t
      from the cmd line in the webserv\apache2\bin dir ?

       
    • Nobody/Anonymous

      hi,

      i deleted all the files/services created by phpdev. And when i ran apache -t it said "Syntax OK".

      However when i run phpinfo it says mod_rewrite is loaded.

      Any ideas??

      Thanks and regards
      sandeep

       
    • Nobody/Anonymous

      what exactly isnt working?

       
    • Nobody/Anonymous

      hi thanks for your replies.

      I am testing mod rewrite on my webserv but aparently it throws a error saying object not found.

      here are the rules i am using:

      <IfModule mod_rewrite.c>
      RewriteEngine on

      RewriteRule ^hardware/(.*)/(.*)/(.*)/(.*) /index.php?prod_id=$2&meta=$3&cat_id=$1&${page=$4}

      RewriteRule ^hardware/(.*)/ /index.php?cat_id=$1
      RewriteRule ^hardware/(.*) /index.php?cat_id=$1

      RewriteRule ^site/(.*)/(.*)/ /page.php?ptype=$2&action=$1
      RewriteRule ^retailers/ /retailers.php?action=retailers
      RewriteRule ^news/(.*)/ /index.php?news_id=$1&action=news
      RewriteRule ^search/ /search.php?action=search
      RewriteRule ^best/ /search.php?best=1&str=andcp.best=1&action=best

      RewriteRule ^info/(.*)/ /index.php?ret_id=$1
      RewriteRule ^rate/(.*)/ /rate.php?ret_id=$1

      RewriteRule ^join/ /join.php

      </IfModule>

      This was working in phpdev but not in webserv :-(

      Reagards
      sandeep

       
    • Nobody/Anonymous

      most likly your in need of a nother module besides mod_rewrite

       
    • Nobody/Anonymous

      hi,

      Thanks all of you for your help. I have finally got mod_rewrite working. I had to changes a few lines in the httpd.conf file to get it working.

      AccessFileName .htaccess
      Allow from all

      <Directory />
        Options FollowSymLinks
        AllowOverride All
        order allow,deny
        allow from all
      </Directory>

      Thats it.

      Regards
      sandeep

       
    • Nobody/Anonymous

      Hi,

      thanks to all of you who replied. I have got it working now. I had to change a few lines in the httpd.conf file to get it working

      <Directory />
        Options FollowSymLinks
        AllowOverride All
        order allow,deny
        allow from all
      </Directory>

      AccessFileName .htaccess
      Allow from all

      Hope this helps someone

      Regards
      sandeep

       

Log in to post a comment.

Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.