SitePoint Sponsor

User Tag List

Results 1 to 6 of 6
  1. #1
    SitePoint Zealot
    Join Date
    Sep 2008
    Posts
    111
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Htaccess not working on windows server

    Hi to all,

    I have a site live on the windows server but the htaccess is not working it give me following error

    404 - File or directory not found.
    The resource you are looking for might have been removed, had its name changed, or is temporarily unavailable.

    I want to show the url like this

    Actual url

    http://www.example.com/categories/index.php?cat=eyes

    I want to show above url like this

    www.example.com/categories/eyes

    My htaccess file is currently site is in subfolder

    Code:
    rewriteengine on
    Options +FollowSymlinks
    RewriteBase /test_php/
    rewriterule ^index.php$ index.php [L]
    rewriterule ^categories/([a-zA-Z0-9_-]+)$ categories/index.php?cat=$1
    thanks in advance.
    Last edited by TechnoBear; May 15, 2012 at 08:56. Reason: Example URLs delinkified

  2. #2
    SitePoint Author silver trophybronze trophy
    wwb_99's Avatar
    Join Date
    May 2003
    Location
    Washington, DC
    Posts
    10,629
    Mentioned
    4 Post(s)
    Tagged
    0 Thread(s)
    IIS does not use .htaccess. If you are on IIS7 then you can use the native url rewriting to get there. That is typically handled in a web.config file.

  3. #3
    Certified Ethical Hacker silver trophybronze trophy dklynn's Avatar
    Join Date
    Feb 2002
    Location
    Auckland
    Posts
    14,653
    Mentioned
    19 Post(s)
    Tagged
    3 Thread(s)
    Wyatt,

    Good info! Where does web.config reside? Content identical to Apache's mod_rewrite directives? Link to M$ info about M$_rewrite? THANKS!

    Regards,

    DK
    David K. Lynn - Data Koncepts is a long-time WebHostingBuzz (US/UK)
    Client and (unpaid) WHB Ambassador
    mod_rewrite Tutorial Article (setup, config, test & write
    mod_rewrite regex w/sample code) and Code Generator

  4. #4
    SitePoint Author silver trophybronze trophy
    wwb_99's Avatar
    Join Date
    May 2003
    Location
    Washington, DC
    Posts
    10,629
    Mentioned
    4 Post(s)
    Tagged
    0 Thread(s)
    All that is very well documented on IIS.net and numerous other sites, no need to repeat it here.

  5. #5
    SitePoint Zealot
    Join Date
    Sep 2008
    Posts
    111
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    thanks for the reply.

    I have found the web.config file but how i can write a rule to convert this dynamic url

    http://www.example.com/categories/index.php?cat=eyes

    to

    http://www.example.com/categories/eyes

    please keep in mind that "eyes" will be dynamic mean in second url may be lips instead of eyes.

    thanks

  6. #6
    . shoooo... silver trophy logic_earth's Avatar
    Join Date
    Oct 2005
    Location
    CA
    Posts
    9,013
    Mentioned
    8 Post(s)
    Tagged
    0 Thread(s)
    Uses search engines....
    http://www.iis.net/download/URLRewrite
    Logic without the fatal effects.
    All code snippets are licensed under WTFPL.



Bookmarks

Posting Permissions

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