htaccess help needed

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • CYF
    Coupon Guru
    • Mar 2009
    • 10973

    #1

    htaccess help needed

    I'm having problems with a script I bought. This is on a freebsd 8.1 machine with apache2.2.17, php5.3.3, mysql5.1.52, and the php5-extensions installed.

    The script seems to work fine on linux, and linux VPS. It seems I'm their only freebsd customer so far. Apparently one other guy had the same issue with his htaccess on a VPS but they fixed his .htaccess file.

    htaccess works fine on this machine, my other sites are using it, so I'm not sure why I'm having a problem with this.

    Any help is appreciated

    <IfModule mod_rewrite.c>

    RewriteEngine On
    RewriteBase /

    RewriteCond %{REQUEST_FILENAME} !-d
    RewriteRule ^(.+)/$ $1 [L,R=301]

    RewriteCond %{REQUEST_URI} ^system.*
    RewriteRule ^(.*)$ /index.php/$1 [L]

    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteCond %{REQUEST_FILENAME} !-d
    RewriteRule ^(.*)$ index.php/$1 [L]

    </IfModule>

    <IfModule !mod_rewrite.c>

    # Without mod_rewrite, route 404's to the front controller
    ErrorDocument 404 /index.php

    </IfModule>
    Webmaster Coupons Coupons and discounts for hosting, domains, SSL Certs, and more!
    AmeriNOC Coupons | Certified Hosting Coupons | Hosting Coupons | Domain Name Coupons

  • myneid
    Confirmed User
    • Jan 2003
    • 736

    #2
    what is the problem? what is it not doing?
    is mod rewrite on on your server? seems sending errordocument 404 to index.php may make it hard to see if its not turned on
    Tanguy 0x7a69 inc. Programmer/President/CEO
    http://www.0x7a69.com
    A Leader in Programming since 1996
    PHP, Ruby on Rails, MySQL, PCI DSS, and any Technical Consulting

    Comment

    • CYF
      Coupon Guru
      • Mar 2009
      • 10973

      #3
      Originally posted by myneid
      what is the problem? what is it not doing?
      is mod rewrite on on your server? seems sending errordocument 404 to index.php may make it hard to see if its not turned on
      it's a coupon script. Kind of a retailmenot clone. Front page lists popular coupons and stores. Clicking on a coupon is supposed to open the website of whatever company the coupon is for, but the script is redirecting to the index page. Clicking a store name is supposed to open a page on my site listing the coupons for that website/store, but it opens the index page again. Also going to /admin is supposed to open the admin area but once again, it opens the main index.php.

      mod_rewrite is indeed installed, I am using it on a wordpress blog.

      If I put gibberish in the .htaccess file then I get an internal server error.
      Webmaster Coupons Coupons and discounts for hosting, domains, SSL Certs, and more!
      AmeriNOC Coupons | Certified Hosting Coupons | Hosting Coupons | Domain Name Coupons

      Comment

      • pornophobic
        Registered User
        • Jan 2011
        • 2

        #4
        Originally posted by CYF
        ... Also going to /admin is supposed to open the admin area but once again, it opens the main index.php.
        What happens when you comment out
        Code:
        ErrorDocument 404 /index.php
        ?
        Do you get a 404 error page?
        Is the script in a site root, or in a directory?

        If your script is in a directory you could try putting the directory name in front of the /index.php like so:
        Code:
        RewriteCond %{REQUEST_URI} ^system.*
        RewriteRule ^(.*)$ /coupondir/index.php/$1 [L]
        Not sure if it will work, hope it helps though.

        Comment

        • CYF
          Coupon Guru
          • Mar 2009
          • 10973

          #5
          Originally posted by pornophobic
          What happens when you comment out
          Code:
          ErrorDocument 404 /index.php
          ?
          Do you get a 404 error page?
          No, nothing changes when I remove that from the htaccess

          Is the script in a site root, or in a directory?
          they're in a subdirectory.

          If your script is in a directory you could try putting the directory name in front of the /index.php like so:
          Code:
          RewriteCond %{REQUEST_URI} ^system.*
          RewriteRule ^(.*)$ /coupondir/index.php/$1 [L]
          Not sure if it will work, hope it helps though.
          Thanks for the suggestion, but that doesn't appear to have any change.

          welcome to gfy
          Webmaster Coupons Coupons and discounts for hosting, domains, SSL Certs, and more!
          AmeriNOC Coupons | Certified Hosting Coupons | Hosting Coupons | Domain Name Coupons

          Comment

          • CYF
            Coupon Guru
            • Mar 2009
            • 10973

            #6
            any other ideas? I'm really stumped on this.
            Webmaster Coupons Coupons and discounts for hosting, domains, SSL Certs, and more!
            AmeriNOC Coupons | Certified Hosting Coupons | Hosting Coupons | Domain Name Coupons

            Comment

            • CYF
              Coupon Guru
              • Mar 2009
              • 10973

              #7
              I tried installing the script on my amerinoc shared hosting. The script worked for the most part but I had an mysql error on the sidebar.

              Seems to be related to the htaccess issue on the freebsd dedicated server, but mod_rewrite is enabled and running.

              any ideas?
              Webmaster Coupons Coupons and discounts for hosting, domains, SSL Certs, and more!
              AmeriNOC Coupons | Certified Hosting Coupons | Hosting Coupons | Domain Name Coupons

              Comment

              • cooldude7
                Confirmed User
                • Nov 2009
                • 4306

                #8
                i dont know much but u should try with freeelancer, they know a lot.
                Last edited by cooldude7; 01-25-2011, 10:17 PM.

                Comment

                • cooldude7
                  Confirmed User
                  • Nov 2009
                  • 4306

                  #9
                  add this

                  Options +FollowSymLinks


                  before
                  RewriteEngine On

                  Comment

                  • CYF
                    Coupon Guru
                    • Mar 2009
                    • 10973

                    #10
                    Originally posted by cooldude7
                    add this

                    Options +FollowSymLinks


                    before
                    RewriteEngine On
                    thanks for the suggestion, I've tried that but it doesn't seem to help.
                    Webmaster Coupons Coupons and discounts for hosting, domains, SSL Certs, and more!
                    AmeriNOC Coupons | Certified Hosting Coupons | Hosting Coupons | Domain Name Coupons

                    Comment

                    • marlboroack
                      So Fucking Banned
                      • Jul 2010
                      • 9327

                      #11
                      I wish i had skills like this. Never to late to learn i guess

                      Comment

                      • CYF
                        Coupon Guru
                        • Mar 2009
                        • 10973

                        #12
                        Originally posted by marlboroack
                        I wish i had skills like this. Never to late to learn i guess
                        I'm digging into it by necessity at this point
                        Webmaster Coupons Coupons and discounts for hosting, domains, SSL Certs, and more!
                        AmeriNOC Coupons | Certified Hosting Coupons | Hosting Coupons | Domain Name Coupons

                        Comment

                        • fris
                          Too lazy to set a custom title
                          • Aug 2002
                          • 55679

                          #13
                          it would be more helpful if we knew something about the script/cms to make the modrewrite to work.

                          remember apache 1.3.x and 2.x.x has a diff rewrite system, some rules will work on 2.x.x and not in 1.3.x
                          Since 1999: 69 Adult Industry awards for Best Hosting Company and professional excellence.

                          Comment

                          Working...