GoFuckYourself.com - Adult Webmaster Forum

GoFuckYourself.com - Adult Webmaster Forum (https://gfy.com/index.php)
-   Fucking Around & Business Discussion (https://gfy.com/forumdisplay.php?f=26)
-   -   Any .htaccess and rewrite experts in the house? Need some help. (https://gfy.com/showthread.php?t=1071047)

Just Alex 06-11-2012 08:45 AM

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 06-11-2012 08:49 AM

Does the new server run 'ngnix' ?

Just Alex 06-11-2012 09:14 AM

Quote:

Originally Posted by Inter-Sex (Post 18998587)
Does the new server run 'ngnix' ?

Hmm, that I do not know. How do I find out?

CYF 06-11-2012 09:18 AM

Quote:

Originally Posted by Just Alex (Post 18998630)
Hmm, that I do not know. How do I find out?

telnet to port 80 and type in:

HEAD / HTTP/1.0

Just Alex 06-11-2012 09:44 AM

centOS 5.5

AdultKing 06-11-2012 10:04 AM

Quote:

Originally Posted by Just Alex (Post 18998681)
centOS 5.5

That's your OS not your web server, what web server are you running ?

DudeRick 06-11-2012 10:06 AM

Your new host is run by pastersinalot...

Just Alex 06-11-2012 10:13 AM

Quote:

Originally Posted by AdultKing (Post 18998727)
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

CYF 06-11-2012 10:21 AM

Quote:

Originally Posted by Just Alex (Post 18998743)
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?

Just Alex 06-11-2012 10:33 AM

Quote:

Originally Posted by CYF (Post 18998756)
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

Quote:

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

CYF 06-11-2012 10:50 AM

Quote:

Originally Posted by Just Alex (Post 18998768)
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?

Just Alex 06-11-2012 11:07 AM

Quote:

Originally Posted by CYF (Post 18998783)
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 :(

- Jesus Christ - 06-11-2012 11:19 AM

Quote:

Originally Posted by Inter-Sex (Post 18998587)
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


CYF 06-11-2012 11:23 AM

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.

Just Alex 06-11-2012 11:28 AM

Quote:

Originally Posted by - Jesus Christ - (Post 18998832)
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 :mad:

WTF? works once I changed it to lower case.

Just Alex 06-11-2012 11:30 AM

Quote:

Originally Posted by CYF (Post 18998837)
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.

CYF 06-11-2012 11:39 AM

Quote:

Originally Posted by Just Alex (Post 18998854)
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 :1orglaugh

Glad you got it working and I could be of (some) assistance :thumbsup

CyberHustler 06-11-2012 11:51 AM

:1orglaugh

Tom_PM 06-11-2012 11:54 AM

Hardly any name calling. 2cents


All times are GMT -7. The time now is 02:04 PM.

Powered by vBulletin® Version 3.8.8
Copyright ©2000 - 2024, vBulletin Solutions, Inc.
©2000-, AI Media Network Inc