Quite some time ago google changes their rules for page "verification" for their webmastertools which you probably know. Now they ban the usage of redirects when a page is not found - google want's a nice "404" error message.
How does that work with liferay? By default liferay redirects all requested URLs that doen't have a corresponding page to the homepage (e.g. /web/guest/home). That's exactly what google does not like. :o/
There are now two different cases that should be distinguished:
- Wrong URLs "behind" the path of the homepage (e.g. www.foo.com/web/guest/hehjoifjal)
- Wrong URLs directly at the root path (e.g. www.foo.com/hehjoifjla )
For 1) there are seetings within liferay that customize that behaviour. These work fine - but just for this use case:
layout.show.http.status=true
layout.friendly.url.page.not.found=/errors/my_404error.htm
For 2) This has to be adjusted on the app-server level (for my: tomcat from the bundle)
Two options:
The proper way - change the routing in the web.xml of the liferay application (in tomcat-5.5.27\webapps\ROOT\WEB-INF). There you change the entry for "error-page.
Or you do it quick and dirty :)
The "error-page" tag points to /errors/404.jsp
You can modify this file directly to turn of the redirection. That is you have to remove:
<body onload="javascript: location.replace('<%= homeURL %>')">
and related.
Now you should be friends with google again. :)
JavaScript Training in CHennai JavaScript Training in CHennai JQuery Online Training JQuery Online Training
ReplyDeleteThanks for sharing the information...
ReplyDeleteSEO Training in Bangalore | SEO Course Fees | Best SEO Classes - Join SEO Training in Bangalore at i Digital Academy and learn how to increase your website Traffic by
Google Certified Trainers with 100% Placements and affordable course fees. Book a Free Demo!
https://saglamproxy.com
ReplyDeletemetin2 proxy
proxy satın al
knight online proxy
mobil proxy satın al
DY3WN
An iOS mobile app development course teaches scalable mobile solutions.It focuses on real use cases.This iOS mobile app development course boosts confidence.It is dependable.
ReplyDelete