Any .htaccess and rewrite experts in the house? Need some help.

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • Just Alex
    Liv Benson to You, Bitch
    • Aug 2007
    • 6060

    #1

    Any .htaccess and rewrite experts in the house? Need some help.

    After moving one of my sites to a new server I cant get images to display. If I remove top part from htaccess file, they show up, but re-write doesn't work. If I add it back, rewrite works but all images are broken. Any idea whats causing it and why my new server doesn't like it?

    Here's htaccess contents:

    Options +FollowSymLinks
    RewriteEngine on
    RewriteCond %{REQUEST_FILENAME} !-F
    RewriteCond %{REQUEST_FILENAME} !-D
    RewriteRule (.*) index.php [L]



    Thanks
  • Inter-Sex
    Confirmed User
    • Nov 2005
    • 2231

    #2
    Does the new server run 'ngnix' ?

    Comment

    • Just Alex
      Liv Benson to You, Bitch
      • Aug 2007
      • 6060

      #3
      Originally posted by Inter-Sex
      Does the new server run 'ngnix' ?
      Hmm, that I do not know. How do I find out?

      Comment

      • CYF
        Coupon Guru
        • Mar 2009
        • 10973

        #4
        Originally posted by Just Alex
        Hmm, that I do not know. How do I find out?
        telnet to port 80 and type in:

        HEAD / HTTP/1.0
        Webmaster Coupons Coupons and discounts for hosting, domains, SSL Certs, and more!
        AmeriNOC Coupons | Certified Hosting Coupons | Hosting Coupons | Domain Name Coupons

        Comment

        • Just Alex
          Liv Benson to You, Bitch
          • Aug 2007
          • 6060

          #5
          centOS 5.5

          Comment

          • AdultKing
            Raise Your Weapon
            • Jun 2003
            • 15601

            #6
            Originally posted by Just Alex
            centOS 5.5
            That's your OS not your web server, what web server are you running ?

            Comment

            • DudeRick
              Confirmed User
              • Feb 2004
              • 1568

              #7
              Your new host is run by pastersinalot...

              Comment

              • Just Alex
                Liv Benson to You, Bitch
                • Aug 2007
                • 6060

                #8
                Originally posted by AdultKing
                That's your OS not your web server, what web server are you running ?
                here's what Im getting from headers


                HTTP/1.1 200 OK
                Date: Mon, 11 Jun 2012 17:10:22 GMT
                Server: Apache/2
                X-Powered-By: PHP/5.2.17

                Comment

                • CYF
                  Coupon Guru
                  • Mar 2009
                  • 10973

                  #9
                  Originally posted by Just Alex
                  here's what Im getting from headers


                  HTTP/1.1 200 OK
                  Date: Mon, 11 Jun 2012 17:10:22 GMT
                  Server: Apache/2
                  X-Powered-By: PHP/5.2.17
                  that would be apache.


                  are you getting any kind of server error?
                  Last edited by CYF; 06-11-2012, 09:26 AM.
                  Webmaster Coupons Coupons and discounts for hosting, domains, SSL Certs, and more!
                  AmeriNOC Coupons | Certified Hosting Coupons | Hosting Coupons | Domain Name Coupons

                  Comment

                  • Just Alex
                    Liv Benson to You, Bitch
                    • Aug 2007
                    • 6060

                    #10
                    Originally posted by CYF
                    that would be apache.


                    are you getting any kind of server error?
                    No. Just broken images all over. As soon as I remove this part, images work but rewrite is gone and all links aren't working

                    Options +FollowSymLinks
                    RewriteEngine on
                    RewriteCond %{REQUEST_FILENAME} !-F
                    RewriteCond %{REQUEST_FILENAME} !-D
                    RewriteRule (.*) index.php [L]

                    Comment

                    • CYF
                      Coupon Guru
                      • Mar 2009
                      • 10973

                      #11
                      Originally posted by Just Alex
                      No. Just broken images all over. As soon as I remove this part, images work but rewrite is gone and all links aren't working
                      CAn you try changing this line:

                      RewriteRule (.*) index.php [L]

                      to this:

                      RewriteRule . /index.php [L]

                      and see if it works?
                      Webmaster Coupons Coupons and discounts for hosting, domains, SSL Certs, and more!
                      AmeriNOC Coupons | Certified Hosting Coupons | Hosting Coupons | Domain Name Coupons

                      Comment

                      • Just Alex
                        Liv Benson to You, Bitch
                        • Aug 2007
                        • 6060

                        #12
                        Originally posted by CYF
                        CAn you try changing this line:

                        RewriteRule (.*) index.php [L]

                        to this:

                        RewriteRule . /index.php [L]

                        and see if it works?
                        That gives me 500 error

                        Comment

                        • - Jesus Christ -
                          Confirmed User
                          • Mar 2003
                          • 7197

                          #13
                          Originally posted by Inter-Sex
                          Does the new server run 'ngnix' ?
                          Fucking LOVE nginx! A bad implementation wouldn't kill images based on .htaccess rules. It could bypass them if you are not correctly passing the request to apache.

                          You might need a rewrite base defined. Try this.

                          Code:
                          Options +FollowSymLinks
                          RewriteEngine on
                          RewriteBase /
                          RewriteCond %{REQUEST_FILENAME} !-d
                          RewriteCond %{REQUEST_FILENAME} !-f
                          RewriteRule ^(.*)$ /index.php

                          Amen

                          Comment

                          • CYF
                            Coupon Guru
                            • Mar 2009
                            • 10973

                            #14
                            I believe you need this line:

                            RewriteBase /

                            Like so:

                            Options +FollowSymLinks
                            RewriteEngine on
                            RewriteBase /
                            RewriteCond %{REQUEST_FILENAME} !-F
                            RewriteCond %{REQUEST_FILENAME} !-D


                            edit: - Jesus Christ - beat me to it.
                            Last edited by CYF; 06-11-2012, 10:24 AM.
                            Webmaster Coupons Coupons and discounts for hosting, domains, SSL Certs, and more!
                            AmeriNOC Coupons | Certified Hosting Coupons | Hosting Coupons | Domain Name Coupons

                            Comment

                            • Just Alex
                              Liv Benson to You, Bitch
                              • Aug 2007
                              • 6060

                              #15
                              Originally posted by - Jesus Christ -
                              Fucking LOVE nginx! A bad implementation wouldn't kill images based on .htaccess rules. It could bypass them if you are not correctly passing the request to apache.

                              You might need a rewrite base defined. Try this.

                              Code:
                              Options +FollowSymLinks
                              RewriteEngine on
                              RewriteBase /
                              RewriteCond %{REQUEST_FILENAME} !-d
                              RewriteCond %{REQUEST_FILENAME} !-f
                              RewriteRule ^(.*)$ /index.php
                              You know what it was? Upper case !-d and !-f

                              WTF? works once I changed it to lower case.

                              Comment

                              • Just Alex
                                Liv Benson to You, Bitch
                                • Aug 2007
                                • 6060

                                #16
                                Originally posted by CYF
                                I believe you need this line:

                                RewriteBase /

                                Like so:

                                Options +FollowSymLinks
                                RewriteEngine on
                                RewriteBase /
                                RewriteCond %{REQUEST_FILENAME} !-F
                                RewriteCond %{REQUEST_FILENAME} !-D


                                edit: - Jesus Christ - beat me to it.
                                Thanks for your help, bro.. Turns out it has to be lower case !-d and !-d. Go figure. So weird because in original script package it was in upper case and worked fine on old server.

                                Comment

                                • CYF
                                  Coupon Guru
                                  • Mar 2009
                                  • 10973

                                  #17
                                  Originally posted by Just Alex
                                  Thanks for your help, bro.. Turns out it has to be lower case !-d and !-d. Go figure. So weird because in original script package it was in upper case and worked fine on old server.
                                  huh, I didn't even notice the upper case

                                  Glad you got it working and I could be of (some) assistance
                                  Webmaster Coupons Coupons and discounts for hosting, domains, SSL Certs, and more!
                                  AmeriNOC Coupons | Certified Hosting Coupons | Hosting Coupons | Domain Name Coupons

                                  Comment

                                  • CyberHustler
                                    Masterbaiter
                                    • Feb 2006
                                    • 28731

                                    #18
                                    “If you can convince the lowest white man he’s better than the best colored man, he won’t notice you’re picking his pocket. Hell, give him somebody to look down on, and he’ll empty his pockets for you.”

                                    Comment

                                    • Tom_PM
                                      Porn Meister
                                      • Feb 2005
                                      • 16443

                                      #19
                                      Hardly any name calling. 2cents
                                      43-922-863 Shut up and play your guitar.

                                      Comment

                                      Working...