The Web Design Group

... Making the Web accessible to all.

Welcome Guest ( Log In | Register )

 
Reply to this topicStart new topic
> Non-existing url leads to home page
stjepan
post Jul 27 2013, 04:57 AM
Post #1


Serious Coder
*****

Group: Members
Posts: 329
Joined: 15-October 06
From: zagreb, croatia
Member No.: 445



Hello,

I've been searching around but found nothing and my hosting also have no idea why a) when some random string is attached to the adress eg. poandpo.com/abdedfgh the response will be 404 but b) when there are uppercase characters, for example poandpo.com/AbCde than the home page is loaded. Does anyone has an idea how to solved that?
User is offlinePM
Go to the top of the page
Toggle Multi-post QuotingQuote Post
Christian J
post Jul 27 2013, 07:53 AM
Post #2


.
********

Group: WDG Moderators
Posts: 8,070
Joined: 10-August 06
Member No.: 7



I get redirected to http://www.poandpo.com/404/ with both http://www.poandpo.com/abc and http://www.poandpo.com/ABC

User is offlinePM
Go to the top of the page
Toggle Multi-post QuotingQuote Post
pandy
post Jul 27 2013, 08:03 AM
Post #3


Don't like donuts. Don't do MySpace.
********

Group: WDG Moderators
Posts: 18,183
Joined: 9-August 06
Member No.: 6



Did you fix this? I get the error page every time.

But there actually is no 404. There's a 302.

CODE
GET /arsdfgjkl/ HTTP/1.1
HTTP/1.1 302 Moved Temporarily


then the page is somehow redirected to /404/ that in turn does return a 404. wacko.gif

CODE

GET /404/ HTTP/1.1
HTTP/1.1 404 Not Found
User is offlinePM
Go to the top of the page
Toggle Multi-post QuotingQuote Post
pandy
post Jul 27 2013, 08:05 AM
Post #4


Don't like donuts. Don't do MySpace.
********

Group: WDG Moderators
Posts: 18,183
Joined: 9-August 06
Member No.: 6



Wait, I got the frontpage with this URL but not with the one you provided or the other ones I made up. biggrin.gif

http://www.poandpo.com/PANDY.HTML
User is offlinePM
Go to the top of the page
Toggle Multi-post QuotingQuote Post
pandy
post Jul 27 2013, 11:29 AM
Post #5


Don't like donuts. Don't do MySpace.
********

Group: WDG Moderators
Posts: 18,183
Joined: 9-August 06
Member No.: 6



Now I get the error page with the pandy-URL too. What the heck are you playing with on that server?
User is offlinePM
Go to the top of the page
Toggle Multi-post QuotingQuote Post
Christian J
post Jul 27 2013, 01:23 PM
Post #6


.
********

Group: WDG Moderators
Posts: 8,070
Joined: 10-August 06
Member No.: 7



QUOTE(Christian J @ Jul 27 2013, 02:53 PM) *

There is a difference. http://www.poandpo.com/abc returns a 302 directly to http://www.poandpo.com/404/ along with a cookie:

CODE
HTTP/1.1·302·Moved·Temporarily(CR)(LF)
Date:·Sat,·27·Jul·2013·18:12:52·GMT(CR)(LF)
Server:·Apache(CR)(LF)
X-Powered-By:·PHP/5.3.24(CR)(LF)
Expires:·Thu,·19·Nov·1981·08:52:00·GMT(CR)(LF)
Cache-Control:·no-store,·no-cache,·must-revalidate,·post-check=0,·pre-check=0(CR)(LF)
Pragma:·no-cache(CR)(LF)
Set-Cookie:·PHPSESSID=56450f00b3203bdc6c68f1158bc0d4d2;·path=/(CR)(LF)
Location:·http://www.poandpo.com/404/(CR)(LF)
Vary:·Accept-Encoding,User-Agent(CR)(LF)
Content-Length:·0(CR)(LF)
Connection:·close(CR)(LF)
Content-Type:·text/html(CR)(LF)
(CR)(LF)

while http://www.poandpo.com/ABC first returns this 301 to http://www.poandpo.com/abc:

CODE
HTTP/1.1·301·Moved·Permanently(CR)(LF)
Date:·Sat,·27·Jul·2013·18:13:26·GMT(CR)(LF)
Server:·Apache(CR)(LF)
Location:·http://www.poandpo.com/abc(CR)(LF)
Content-Length:·234(CR)(LF)
Connection:·close(CR)(LF)
Content-Type:·text/html;·charset=iso-8859-1(CR)(LF)
(CR)(LF)

and from there the 302 to http://www.poandpo.com/404/.

Could the cookies have anything to do with this?


User is offlinePM
Go to the top of the page
Toggle Multi-post QuotingQuote Post
pandy
post Jul 27 2013, 01:35 PM
Post #7


Don't like donuts. Don't do MySpace.
********

Group: WDG Moderators
Posts: 18,183
Joined: 9-August 06
Member No.: 6



wacko.gif wacko.gif wacko.gif

What is doing this? A .htacces file or PHP or something out of your control, that is the question. sleep.gif
User is offlinePM
Go to the top of the page
Toggle Multi-post QuotingQuote Post
pandy
post Jul 27 2013, 01:40 PM
Post #8


Don't like donuts. Don't do MySpace.
********

Group: WDG Moderators
Posts: 18,183
Joined: 9-August 06
Member No.: 6



I snooped up a couple of other domains on the same server, and they have normal 404s. So I'd say it's your own doing. tongue.gif

http://albumi.info/dfgsadgsfg
User is offlinePM
Go to the top of the page
Toggle Multi-post QuotingQuote Post
stjepan
post Jul 27 2013, 06:14 PM
Post #9


Serious Coder
*****

Group: Members
Posts: 329
Joined: 15-October 06
From: zagreb, croatia
Member No.: 445



Thank you all for all those tests :-) I made changes to .htaccess to convert mixed case to lowercase letters and now it's fine. I'll have to look at cookies again, there are two of them, one added a few weeks ago, to see did I missed something. Just to add that I read probably all articles published about similar problems on the Northern Hemisphere and found no answer, just thousands of non-working solutions from "gurus". Htmlhelp rulez, other "webmasters"... I'll stop here.

And I must go through code again to check did I miss some side-effect since I rewrote almost all CMS and after several thousand lines I feel sick :-)

This post has been edited by stjepan: Jul 27 2013, 06:16 PM
User is offlinePM
Go to the top of the page
Toggle Multi-post QuotingQuote Post
pandy
post Jul 28 2013, 03:45 AM
Post #10


Don't like donuts. Don't do MySpace.
********

Group: WDG Moderators
Posts: 18,183
Joined: 9-August 06
Member No.: 6



But it must be something you've done. Look through your .htaccess.
User is offlinePM
Go to the top of the page
Toggle Multi-post QuotingQuote Post
stjepan
post Jul 28 2013, 09:01 AM
Post #11


Serious Coder
*****

Group: Members
Posts: 329
Joined: 15-October 06
From: zagreb, croatia
Member No.: 445



After solving my problem so brilliantly that I made the slowest website in the known universe, I returned to old .htaccess. So, the problem is still here but it's less damage than having a site slow as a turtle.

Here is my .htaccess file if someone has time and will to take a look, something is obviously missing:

CODE
RewriteEngine On
Redirect 301 http://poandpo.com http://www.poandpo.com
RewriteCond %{REQUEST_FILENAME} -f
RewriteRule ^(.*) $1 [L]
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ index.php?category=$1 [L]
User is offlinePM
Go to the top of the page
Toggle Multi-post QuotingQuote Post
Christian J
post Jul 28 2013, 01:02 PM
Post #12


.
********

Group: WDG Moderators
Posts: 8,070
Joined: 10-August 06
Member No.: 7



CODE
RewriteEngine On
Redirect 301 http://poandpo.com http://www.poandpo.com

The above doesn't seem to work. According to http://httpd.apache.org/docs/current/mod/m...s.html#redirect (do you use Apache 2.4?) the old URL path should begin with a slash.

Not sure about the rest of the .htaccess file.
User is offlinePM
Go to the top of the page
Toggle Multi-post QuotingQuote Post
stjepan
post Jul 28 2013, 02:27 PM
Post #13


Serious Coder
*****

Group: Members
Posts: 329
Joined: 15-October 06
From: zagreb, croatia
Member No.: 445



Thanks for this, I'm on 2.2.24.
User is offlinePM
Go to the top of the page
Toggle Multi-post QuotingQuote Post
pandy
post Jul 28 2013, 02:33 PM
Post #14


Don't like donuts. Don't do MySpace.
********

Group: WDG Moderators
Posts: 18,183
Joined: 9-August 06
Member No.: 6



I think this
CODE
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ index.php?category=$1 [L]


means that if the the file isn't a directory (!-d), redirect to index.php?category=...

Only problem is it doesn't seem to work that way. unsure.gif
User is offlinePM
Go to the top of the page
Toggle Multi-post QuotingQuote Post
stjepan
post Jul 29 2013, 03:04 PM
Post #15


Serious Coder
*****

Group: Members
Posts: 329
Joined: 15-October 06
From: zagreb, croatia
Member No.: 445



It is redirecting and rewriting php?style?category?names into more friendly URLs. I'm afraid I'll have to go into php code again, maybe I can make things simpler.
User is offlinePM
Go to the top of the page
Toggle Multi-post QuotingQuote Post

Reply to this topicStart new topic
1 User(s) are reading this topic (1 Guests and 0 Anonymous Users)
0 Members:

 



- Lo-Fi Version Time is now: 22nd March 2019 - 08:56 AM