Non-existing url leads to home page |
Non-existing url leads to home page |
stjepan |
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? |
Christian J |
Jul 27 2013, 07:53 AM
Post
#2
|
. Group: WDG Moderators Posts: 9,667 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
|
pandy |
Jul 27 2013, 08:03 AM
Post
#3
|
馃専Computer says no馃専 Group: WDG Moderators Posts: 20,734 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. CODE GET /404/ HTTP/1.1 HTTP/1.1 404 Not Found |
pandy |
Jul 27 2013, 08:05 AM
Post
#4
|
馃専Computer says no馃専 Group: WDG Moderators Posts: 20,734 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.
http://www.poandpo.com/PANDY.HTML |
pandy |
Jul 27 2013, 11:29 AM
Post
#5
|
馃専Computer says no馃専 Group: WDG Moderators Posts: 20,734 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?
|
Christian J |
Jul 27 2013, 01:23 PM
Post
#6
|
. Group: WDG Moderators Posts: 9,667 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 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? |
pandy |
Jul 27 2013, 01:35 PM
Post
#7
|
馃専Computer says no馃専 Group: WDG Moderators Posts: 20,734 Joined: 9-August 06 Member No.: 6 |
What is doing this? A .htacces file or PHP or something out of your control, that is the question. |
pandy |
Jul 27 2013, 01:40 PM
Post
#8
|
馃専Computer says no馃専 Group: WDG Moderators Posts: 20,734 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.
http://albumi.info/dfgsadgsfg |
stjepan |
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 |
pandy |
Jul 28 2013, 03:45 AM
Post
#10
|
馃専Computer says no馃専 Group: WDG Moderators Posts: 20,734 Joined: 9-August 06 Member No.: 6 |
But it must be something you've done. Look through your .htaccess.
|
stjepan |
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] |
Christian J |
Jul 28 2013, 01:02 PM
Post
#12
|
. Group: WDG Moderators Posts: 9,667 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. |
stjepan |
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.
|
pandy |
Jul 28 2013, 02:33 PM
Post
#14
|
馃専Computer says no馃専 Group: WDG Moderators Posts: 20,734 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. |
stjepan |
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.
|
Lo-Fi Version | Time is now: 21st May 2024 - 09:38 AM |