Showing posts with label Web. Show all posts
Showing posts with label Web. Show all posts

Thursday, January 5, 2012

Determine user in Tomcat

To determine user authentication info in Tomcat, we can use the following:

getRemoteUser()
isUserInRole(String role)

Both methods are under javax.servlet.http.HttpServletRequest.

Wednesday, June 1, 2011

Search Engine Optimization Technique

For SEO, there are few things to note.

  1. Meaningful title
    "Production name | Description"

  2. Use of meta tag
    META DESCRIPTION, META KEYWORD

  3. Use of canonical link
    http://googlewebmastercentral.blogspot.com/2009/02/specify-your-canonical.html

  4. Use of SiteMap
    http://code.google.com/p/googlessitemapgenerator/
    http://www.sitemaps.org/protocol.php

  5. Use alt text


More information:

  1. http://static.googleusercontent.com/external_content/untrusted_dlcp/www.google.com/zh-TW//webmasters/docs/search-engine-optimization-starter-guide.pdf

  2. http://www.seomoz.org/beginners-guide-to-seo

Sunday, October 10, 2010

Using X-Forward-For Header

Say if you have a web server on top of your application server, you can use "x-Forward-For" HTTP header in the application server to get the real IP of the client.

Note: Remote host only returns the IP of the web server instead.

Wednesday, September 5, 2007

phpgraphy album title length

The title length of albums could be modified at:
found in file "/base/include/yorsh-varval-request_data.inc.php"

field dirtitle

verison 0.93.

Tuesday, June 19, 2007

Context level of Moodle

From lib/accesslib.php

25 // context definitions
26 define('CONTEXT_SYSTEM', 10);
27 define('CONTEXT_PERSONAL', 20);
28 define('CONTEXT_USER', 30);
29 define('CONTEXT_COURSECAT', 40);
30 define('CONTEXT_COURSE', 50);
31 define('CONTEXT_GROUP', 60);
32 define('CONTEXT_MODULE', 70);
33 define('CONTEXT_BLOCK', 80);

Thursday, September 7, 2006

Redirect Apache request to IIS

Just got some ideas for redirecting Apache request to IIS, if anyone make this work, please let me know.

RewriteEngine on
RewriteRule ^/(.*\.asp)$ http://localhost:81/$1 [P]

CSP on Apache

To add CSP to root if sort of funny. The following will NOT work for most cases !!     <LocationMatch "^/$">        Header s...