Mod Rewrites

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • phpmind
    New Member
    • Feb 2008
    • 16

    #1

    Mod Rewrites

    I tried using the mod Rewrite feature by turning on the rewrite engine and using it in the htaccess file. I contacted my web hosting company and they said windows users cannot use the htaccess file and I would have to purchase software in order to use mod rewrite. Does anyone know another way to do rewrites outside of the htaccess file ?
  • Markus
    Recognized Expert Expert
    • Jun 2007
    • 6092

    #2
    Do you have to purchase this 'software' from them?

    Robbing %#!"#!%

    Unfortuantely, i have not heard of any other way of achieving mod_rewrites outside of htaccess.

    Hopefully someone else has!

    Comment

    • ronverdonk
      Recognized Expert Specialist
      • Jul 2006
      • 4259

      #3
      I have no experience with rewrite outside Apache, but I found an entry in the phpclasses.org site, where the developer claims that it works with and without Apache. So have look HERE and see if it is useable for you.

      Ronald

      Comment

      • phpmind
        New Member
        • Feb 2008
        • 16

        #4
        I took a look at this and it seems it does require an Apache server. I am thinking about purchasing the mod rewrite license for the Windows Server environment. If anybody knows a way to do the rewrites outside of Apache let me know, it will save me a few bucks.

        Comment

        • phpmind
          New Member
          • Feb 2008
          • 16

          #5
          ronverdonk, one other question, from what you know about mod rewrites on Apache tell me if this is possible:
          Say I have a page that brings up a users information. i.e.
          www.mysite.com/results.php?use r=1

          The mod rewrite can write it out like:
          www.mysite.com/user1/

          My question: Can I then use the url www.mysite.com/user1/ to access the page directly that give would give me the users information. In other words would www.mysite.com/user1/ execute www.mysite.com/results.php?use r=1

          Comment

          • Markus
            Recognized Expert Expert
            • Jun 2007
            • 6092

            #6
            Originally posted by phpmind
            My question: Can I then use the url www.mysite.com/user1/ to access the page directly that give would give me the users information. In other words would www.mysite.com/user1/ execute www.mysite.com/results.php?use r=1
            It would indeed.
            Just use
            [php]
            $_GET['user'];
            [/php]
            To retrieve it.

            Comment

            • henryrhenryr
              New Member
              • Jun 2007
              • 103

              #7
              Originally posted by phpmind
              I tried using the mod Rewrite feature by turning on the rewrite engine and using it in the htaccess file. I contacted my web hosting company and they said windows users cannot use the htaccess file and I would have to purchase software in order to use mod rewrite. Does anyone know another way to do rewrites outside of the htaccess file ?
              I use windows and apache (local) and linux/apache (live) and I use .htaccess.

              Maybe they are referring to the point that Windows doesn't like .htaccess because it starts will a "."

              I can save .htaccess correctly with context - www.context.cx - probably the same with most text editors except notepad?

              err...if you want the functionality of mod_rewrite on IIS then I suppose that's another question - I'm sure I read that you can. Or just switch to a host with Apache.

              Comment

              • phpmind
                New Member
                • Feb 2008
                • 16

                #8
                I instaled the mod rewrite feature for IIS. Now I am trying to use it and cannot get to work
                .
                Example:
                I want the mod rewrite to execute
                www.mysite.com/results.php?use r=20
                when a user types in the following:
                www.mysite.com/user20/

                Is this the correct code to get this to work ?

                Code(php):
                RewriteEngine on
                RewriteRule ^([.*])/$ results.php?use r=$1 [L]

                Comment

                • phpmind
                  New Member
                  • Feb 2008
                  • 16

                  #9
                  I did get this working but one problem I am having is it pulls up the page ok but the header and footer do not look correct. Does the htaccess file have to exist in subfolders for files that are not in the root directory. How is this handled ?

                  Comment

                  Working...