| Author |
|
ecrmsupport Newbie

Joined: 29 June 2009
Online Status: Offline Posts: 10
|
| Posted: 29 June 2009 at 1:51pm | IP Logged
|
|
|
Hi, Iam using your 2.0 version of URL rewriting dll. I have a peculiar scenario. My website is in MCMS 2002, and I have lots of other MCMS 2002 websites in the same server. I have implemented the URL rewriting for all these websites. Now, for one of the website, say http://website1.com, I need to configure a 404 page not found error. I have a section of this website developed in .NET, and there i could easily configure the 404 for that site. But the CMS part, where I try to access a invalid URL which is URL rewritten, I am not taken to the custom 404 page not found. Can you pls help if my version of URL rewrite dll supports the 404 page nt found redirection, if so, can you pls let me know what needs to be done. FYI, the custom 404 page not found redirection works, if I give the actual URL (not the URL rewritten one), and it takes me to the 404 page not found which I have configured. Pls help.. Thanks, Madhu.
|
| Back to Top |
|
| |
Lexey Moderator Group

Joined: 15 August 2002 Location: Russian Federation
Online Status: Offline Posts: 8080
|
| Posted: 30 June 2009 at 5:51am | IP Logged
|
|
|
ISAPI_Rewrite does not interact with custom error handlers. And it will not process a 404 handler URI.
|
| Back to Top |
|
| |
ecrmsupport Newbie

Joined: 29 June 2009
Online Status: Offline Posts: 10
|
| Posted: 30 June 2009 at 7:10am | IP Logged
|
|
|
Hi,
Thx for the reply. THe point is that if I try accessing an invalid MCMS URL (the actual URL and not the URL rewritten one), I am properly taken to the 404 page not found custom page that I created. But for the URL rewritten URLs, its not helping me to take to the custom 404 page. So just thought if I need to do some scripting or any validation rule in the httpd.ini file, to specify that for the invalid URL rewritten URLs, take the user to the custom 404 page (for that particular website). Any help is much appreciated. Thanks, Madhu.
|
| Back to Top |
|
| |
Lexey Moderator Group

Joined: 15 August 2002 Location: Russian Federation
Online Status: Offline Posts: 8080
|
| Posted: 30 June 2009 at 7:54am | IP Logged
|
|
|
Sorry, but I do not understand your problem from this description. Could you show me a sample step-by-step use case in a format like that:
1) I take the "/foo" URI.
2) It is being rewritten as "/bar".
3) I expect "something" but "something else" is happening.
|
| Back to Top |
|
| |
ecrmsupport Newbie

Joined: 29 June 2009
Online Status: Offline Posts: 10
|
| Posted: 30 June 2009 at 8:06am | IP Logged
|
|
|
Hi, sure here is the example.
I have a MCMS 2002 website http://abc.com which has pages which follow channel structure like below. http://abc.com/123/01/default.htm http://abc.com/345/05/index.htm http://abc.com/123/03/products.htm
Now in httpd.ini I have the URL rewritten so that I get the following URLs http://abc.com/default.htm
http://abc.com/index.htm
http://abc.com/products.htm
Now, the URL rewriting works well for me for the above valid URLs. I have created a custom 404 page not found error page for this MCMS 2002 website. When I type an invalid URL say http://abc.com/123/03/products123.htm it takes me to the 404 custom page But for the rewritten URL
http://abc.com/products.htm, if I try an invalid URL say
http://abc.com/products012.htm, it takes me only to the page not found, and not the custom page. Hope this is clear, if not, pls feel freeto ask, and I can explain more. FYI, the site is in MCMS 2002, and there are lot of websites hosted in MCMS 2002 in the same server and all these domains point to a single virtual directory (IP address).
|
| Back to Top |
|
| |
ecrmsupport Newbie

Joined: 29 June 2009
Online Status: Offline Posts: 10
|
| Posted: 01 July 2009 at 2:15pm | IP Logged
|
|
|
|
| Back to Top |
|
| |
ecrmsupport Newbie

Joined: 29 June 2009
Online Status: Offline Posts: 10
|
| Posted: 01 July 2009 at 2:15pm | IP Logged
|
|
|
Hi, Just curious to know if you are clear with what I was trying to say. pls let me know if you need any further clarification. Many Thx for your support
|
| Back to Top |
|
| |
Lexey Moderator Group

Joined: 15 August 2002 Location: Russian Federation
Online Status: Offline Posts: 8080
|
| Posted: 02 July 2009 at 5:53am | IP Logged
|
|
|
Show your rules, please. And tell me where have you set up your custom 404 handler?
|
| Back to Top |
|
| |
ecrmsupport Newbie

Joined: 29 June 2009
Online Status: Offline Posts: 10
|
| Posted: 04 July 2009 at 8:14am | IP Logged
|
|
|
Hi, Thx for your reply. Here is thepiece of rules that I have in httpd.ini
#Pedigree France RewriteCond Host: www\.pedigree\.fr RewriteRule /home/page-accueil.htm /Pedigree/fr-fr/home/page-accueil.htm [I,L] RewriteCond Host: pedigree\.fr RewriteRule /home/page-accueil.htm /Pedigree/fr-fr/home/page-accueil.htm [I,L]
RewriteRule /home/ /Pedigree/fr-fr/home/page-accueil.htm [I,L]
RewriteRule /marque/default.htm /Pedigree/fr-fr/marque/default.htm [I,L]
But I dont know if I type an invalid URL say /home123/page-accueil.htm it just throws 404 page cant be displayed, instead of custom 404 page not found that we have set up at IIS level. As I mentioned in my previous posts, the custom 404 works if I type an invalid URL with full channel structure say /Pedigree123/fr-fr/home/page-accueil.htm
Pls help.... Thanks a lot for your support.
|
| Back to Top |
|
| |
Lexey Moderator Group

Joined: 15 August 2002 Location: Russian Federation
Online Status: Offline Posts: 8080
|
| Posted: 04 July 2009 at 9:46am | IP Logged
|
|
|
Quote:
| Thx for your reply. Here is thepiece of rules that I have in httpd.ini |
|
|
I need the whole ruleset or at least a part of it relevant to the URIs in question. And the above rules are irrelevant to these URLs (/home123/page-accueil.htm and /Pedigree123/fr-fr/home/page-accueil.htm)
Quote:
But I dont know if I type an invalid URL say /home123/page-accueil.htm it just throws 404 page cant be displayed, instead of custom 404 page not found that we have set up at IIS level.
As I mentioned in my previous posts, the custom 404 works if I type an invalid URL with full channel structure say /Pedigree123/fr-fr/home/page-accueil.htm |
|
|
Most probably you have set up a 404 handler only for a specific application but not for the whole site. Therefore, wrong URIs targeting this application will be handled by your handler but others will be handled by a default IIS handler.
|
| Back to Top |
|
| |
ecrmsupport Newbie

Joined: 29 June 2009
Online Status: Offline Posts: 10
|
| Posted: 06 July 2009 at 2:37am | IP Logged
|
|
|
Hi, Thanks for your reply. I think I was not pretty clear. I mean to say that the 404 works if I type the original URL, but it doesnt work for the friendly URL (ie. for the URLs in the httpd.ini file) Here is part of rule set that Ihave defined for my website http://pedigree.fr #Pedigree France RewriteCond Host: www\.pedigree\.fr RewriteRule /home/page-accueil.htm /Pedigree/fr-fr/home/page-accueil.htm [I,L] RewriteCond Host: pedigree\.fr RewriteRule /home/page-accueil.htm /Pedigree/fr-fr/home/page-accueil.htm [I,L] RewriteRule /home/ /Pedigree/fr-fr/home/page-accueil.htm [I,L] RewriteRule /marque/default.htm /Pedigree/fr-fr/marque/default.htm [I,L]
For the above ruleset, as you see we have two components, one is the friendly URL, and the other one in the right which is the original URL. If I type the original URL and try to access an invalidpage it takes me to the custom 404 page. But not for the friendly URL.
Lets take the above example (say the last URL) RewriteRule /marque/default.htm /Pedigree/fr-fr/marque/default.htm [I,L]
In this, if I type an invalid URL, say (default123 instead of default.htm) http://pedigree.fr/Pedigree/fr-fr/marque/default123.htm But now type http://pedigree.fr/marque/default123.htm, it just says page cant be displayed. Iam just looking at any specific rule which I need to include, which could say, after looking at the matches for the friendly URLs, it should take me to the 404 custom page not found page. Hope the above helps you to understand the issue? Many thanks for your support.
|
| Back to Top |
|
| |
ecrmsupport Newbie

Joined: 29 June 2009
Online Status: Offline Posts: 10
|
| Posted: 07 July 2009 at 1:40am | IP Logged
|
|
|
Eagerly waiting for your reply  thx for your support
|
| Back to Top |
|
| |
Lexey Moderator Group

Joined: 15 August 2002 Location: Russian Federation
Online Status: Offline Posts: 8080
|
| Posted: 07 July 2009 at 12:56pm | IP Logged
|
|
|
Quote:
| If I type the original URL and try to access an invalidpage it takes me to the custom 404 page. |
|
|
This sentence is meaningless. You could either access an original URL or an invalid one.
Quote:
In this, if I type an invalid URL, say (default123 instead of default.htm) http://pedigree.fr/Pedigree/fr-fr/marque/default123.htm
But now type http://pedigree.fr/marque/default123.htm, it just says page cant be displayed. |
|
|
Again, obviously you have set up a custom 404 handler for the "/Pedigree/fr-fr/marque/" virtual path but not for the "/marque" path. That is the main problem.
You could partially solve it with a more generic rule like:
RewriteRule /marque/([^/?]+)\.htm /Pedigree/fr-fr/marque/$1.htm [I,L]
But it will not help if a user will enter something like:
/mrque/default.htm.
If you do not have real htm files on your site then you could also set up a "catch all" rule at the end of a httpd.ini to forward anything to a 404 handler:
RewriteRule [^?]+\.htm /Pedigree/fr-fr/404 [I,L]
|
| Back to Top |
|
| |
ecrmsupport Newbie

Joined: 29 June 2009
Online Status: Offline Posts: 10
|
| Posted: 07 July 2009 at 4:51pm | IP Logged
|
|
|
Hi, Thanks for the generic rule that you gave last, it did the job for me.  however, as you mentioned it doesnt work if the URL doesnt end with .htm. For this, is it okay, if I try adding RewriteRule [^?] /Pedigree/fr-fr/404 [I,L]
not sure, sorry, this should be the last question.. :)
|
| Back to Top |
|
| |
Lexey Moderator Group

Joined: 15 August 2002 Location: Russian Federation
Online Status: Offline Posts: 8080
|
| Posted: 08 July 2009 at 3:55pm | IP Logged
|
|
|
I am afraid that it will force all requests to linked resources (images, style sheets, etc) to return 404 error.
|
| Back to Top |
|
| |
ecrmsupport Newbie

Joined: 29 June 2009
Online Status: Offline Posts: 10
|
| Posted: 08 July 2009 at 4:02pm | IP Logged
|
|
|
Hi, am sorry, but I see a bigger problem, after I update the above rule that you suggested, in the httpd.ini file, for whatever other websites (for which I have rules specified in httpd.ini) it takes me to the custom 404 page. This rule doesnt seem to work only for 404 errors of one website. I thought rewritecondhost for pedigree FR would protect this 404 rule only for pedigree website. Is it not possible to customise this 404 rule only to this website ruleset ? Many Thanks for your reply..
|
| Back to Top |
|
| |
Lexey Moderator Group

Joined: 15 August 2002 Location: Russian Federation
Online Status: Offline Posts: 8080
|
| Posted: 09 July 2009 at 9:36am | IP Logged
|
|
|
ISAPI_Rewrite knows nothing about your virtual sites (only real IIS web sites could be distinguished). It operates on a request URI. So, if a request URI will match a rule condition it will be rewritten.
|
| Back to Top |
|
| |