File not Found Issue
14 posts
• Page 1 of 1
- MarcoMantica
- Posts: 3
- Joined: 15 Apr 2014, 06:33
File not Found Issue
Hi members of forum!
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
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
Re: File not Found Issue
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.
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.
- MarcoMantica
- Posts: 3
- Joined: 15 Apr 2014, 06:33
Re: File not Found Issue
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
Thank you very much!
Marco
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
Thank you very much!
Marco
- HeliconAndrew
- Posts: 1264
- Joined: 07 Mar 2012, 10:16
Re: File not Found Issue
Marco,
Try to use the following:
So that if the file OR directory is real, we rewrite. If not - do nothing and subsequently hit 404
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
- MarcoMantica
- Posts: 3
- Joined: 15 Apr 2014, 06:33
Re: File not Found Issue
Thank you very very very much Andrew... problem solved!
All the best,
Marco
All the best,
Marco
Re: File not Found Issue
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.
Re: File not Found Issue
If you are still looking for some essay help, you may consider visiting this site https://domyhomework.guru/
- AuditingFirm
- Posts: 1
- Joined: 21 Sep 2017, 07:00
Re: File not Found Issue
Thank you for sharing the solutions.It helped me too
- Bestporngifs
- Posts: 1
- Joined: 09 Nov 2017, 17:39
Best Porn Gifs
This was a very good article and very informative.
http://bestporngifs.org
<a href="http://bestporngifs.org/">porn gif</a>
bestporngifs.org
http://bestporngifs.org
<a href="http://bestporngifs.org/">porn gif</a>
bestporngifs.org
- 69lesbianpornsex
- Posts: 1
- Joined: 15 Nov 2017, 16:58
free lesbian porn
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>
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>
hardcoresexvideo
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>
In this blog article is very useful and informative.
I like this post.
http://hardcoresexvideo.org/
<a href="http://hardcoresexvideo.org/">hardcore sex</a>
- 69asianporn
- Posts: 1
- Joined: 20 Nov 2017, 14:09
69asianporn
The information provided was very u pto to the knowledge.
http://69asianporn.org/
<a href="http://69asianporn.org/">asian porn</a>
http://69asianporn.org/
<a href="http://69asianporn.org/">asian porn</a>
- Sobhana123
- Posts: 1
- Joined: 18 Dec 2017, 08:57
Re: File not Found Issue
hii. I don't now this topic please tell me any one thank you.
ISO 9001 Consultant in Oman
ISO 9001 Consultant in Oman
14 posts
• Page 1 of 1
Who is online
Users browsing this forum: No registered users and 0 guests