File not Found Issue

Common questions to Helicon Tech
User avatar
Posts: 3
Joined: 15 Apr 2014, 06:33

File not Found Issue

15 Apr 2014, 07:07

Hi members of forum! :D
I have used ISAPI Rewrite many times : i have installed it on my webserver (Windows Server 2003/IIS6), but this time my customer put me in crisis ;)

He wants that the homepage of his website (in different languages) should be rewritten like this:

site.com/en/
site.com/it/ etc etc...

I put an example of my code (folder /en):

<VirtualHost site.com>

RewriteEngine on
AllowOverride all
RewriteBase /

#EXAMPLE OF A PAGE
RewriteCond %{QUERY_STRING} ^codlin=1$
RewriteRule ^About.aspx$ en/company? [L,R=301,NC]
RewriteRule ^en/company About.aspx\?codlin=1

#EXAMPLE OF HOMEPAGE
RewriteCond %{QUERY_STRING} ^codlin=1$
RewriteRule ^main.aspx$ en? [L,R=301,NC]
RewriteRule ^en main.aspx\?codlin=1

</VirtualHost>

It works correctly for existing pages, but if i try to call a NOT EXISTING page the content SHOW THE HOME PAGE (without being redirected) and not to my customized "Error 404" page.

Examples:

site.com/en/testpage SHOWS site.com/en/ INSTEAD OF "404 - File not found"
site.com/en/blahblah.aspx SHOWS site.com/en/ INSTEAD OF "404 - File not found"

Is it possible to fix this issue? What's wrong with my code?

Thank you very much for help.

Marco

User avatar
Posts: 871
Joined: 12 Mar 2012, 09:54

Re: File not Found Issue

15 Apr 2014, 07:28

Hello, Marco

It would be helpful to see rewrite.log, it will immediately be clear why the non-existing pages are not handled correctly.
Please enable logging in httpd.conf by putting

RewriteLogLevel 9

and provide records for the request to a non-existing page.

User avatar
Posts: 3
Joined: 15 Apr 2014, 06:33

Re: File not Found Issue

16 Apr 2014, 13:17

Hi Anton, thank you for the reply!

This log is about a non-existing page called "en/aaa" under the "/en" root, that should show my customized page "404-file not found" instead of "/en" contents:

Wed, 16-Apr-2014 18:05:11 GMT [site.com/sid#1804615669][rid#26577440/initial] (2) init rewrite engine with requested uri /en/aaa
Wed, 16-Apr-2014 18:05:11 GMT [site.com/sid#1804615669][rid#26577440/initial] (1) Htaccess process request D:\ISAPI_Rewrite3\httpd.conf
Wed, 16-Apr-2014 18:05:11 GMT [site.com/sid#1804615669][rid#26577440/initial] (1) Htaccess process request
Wed, 16-Apr-2014 18:05:11 GMT [site.com/sid#1804615669][rid#26577440/initial] (3) applying pattern '^/About.aspx$' to uri '/en/aaa'
Wed, 16-Apr-2014 18:05:11 GMT [site.com/sid#1804615669][rid#26577440/initial] (3) applying pattern '^/main.aspx$' to uri '/en/aaa'
Wed, 16-Apr-2014 18:05:11 GMT [site.com/sid#1804615669][rid#26577440/initial] (3) applying pattern '/en/company' to uri '/en/aaa'
Wed, 16-Apr-2014 18:05:11 GMT [site.com/sid#1804615669][rid#26577440/initial] (3) applying pattern '/en' to uri '/en/aaa'
Wed, 16-Apr-2014 18:05:11 GMT [site.com/sid#1804615669][rid#26577440/initial] (1) Rewrite URL to >> /main.aspx?codlin=1
Wed, 16-Apr-2014 18:05:11 GMT [site.com/sid#1804615669][rid#26577440/initial] (2) rewrite '/en/aaa' -> '/main.aspx?codlin=1'
Wed, 16-Apr-2014 18:05:11 GMT [site.com/sid#1804615669][rid#26577440/initial] (2) internal redirect with /main.aspx?codlin=1 [INTERNAL REDIRECT]

Hope this helps to find a solution :D
Thank you very much!

Marco

User avatar
Posts: 1264
Joined: 07 Mar 2012, 10:16

Re: File not Found Issue

21 Apr 2014, 10:23

Marco,

Try to use the following:

Code: Select all
RewriteCond %{REUQEST_FILENAME} -f [OR]
RewriteCond %{REUQEST_FILENAME} -d
RewriteRule ^en main.aspx\?codlin=1


So that if the file OR directory is real, we rewrite. If not - do nothing and subsequently hit 404

User avatar
Posts: 3
Joined: 15 Apr 2014, 06:33

Re: File not Found Issue

23 Apr 2014, 12:42

Thank you very very very much Andrew... problem solved!

All the best,
Marco

User avatar
Posts: 1
Joined: 16 Jan 2017, 07:49
Location: Bangalore

Re: File not Found Issue

16 Jan 2017, 07:53

Ohh god..Thank you so much.I have the same issue occurred.Now i am solved that issue.Thank you so much for giving me a wonderful information.

User avatar
Posts: 1
Joined: 14 Jun 2017, 09:01

Re: File not Found Issue

14 Jun 2017, 09:06

If you are still looking for some essay help, you may consider visiting this site https://domyhomework.guru/

User avatar
Posts: 1
Joined: 21 Sep 2017, 07:00

Re: File not Found Issue

21 Sep 2017, 07:13

Thank you for sharing the solutions.It helped me too

User avatar
Posts: 1
Joined: 09 Nov 2017, 17:39

Best Porn Gifs

09 Nov 2017, 17:54

This was a very good article and very informative.

http://bestporngifs.org

<a href="http://bestporngifs.org/">porn gif</a>

bestporngifs.org

User avatar
Posts: 1
Joined: 15 Nov 2017, 16:58

free lesbian porn

15 Nov 2017, 17:11

Hi..
your post is so useful blog.
Thank you so much for giving me a wonderful information.
http://69lesbianpornsex.com/

<a href="http://69lesbianpornsex.com/">free lesbian porn</a>

User avatar
Posts: 1
Joined: 17 Nov 2017, 13:38

hardcoresexvideo

17 Nov 2017, 13:43

Good post.
In this blog article is very useful and informative.
I like this post.
http://hardcoresexvideo.org/


<a href="http://hardcoresexvideo.org/">hardcore sex</a>

User avatar
Posts: 1
Joined: 17 Nov 2017, 17:46

pornhub1

17 Nov 2017, 17:53

This is a very important Helicon Tech . .They are some issue occurred.Thank you so much for giving me a wonderful information.

http://pornhub5.com/

<a href="http://pornhub5.com/">porn hub</a>

User avatar
Posts: 1
Joined: 20 Nov 2017, 14:09

69asianporn

20 Nov 2017, 14:23

The information provided was very u pto to the knowledge.


http://69asianporn.org/

<a href="http://69asianporn.org/">asian porn</a>

User avatar
Posts: 1
Joined: 18 Dec 2017, 08:57

Re: File not Found Issue

18 Dec 2017, 09:02

hii. I don't now this topic please tell me any one thank you.

ISO 9001 Consultant in Oman

Return to Common Questions

Who is online

Users browsing this forum: No registered users and 1 guest