I always wondered on how the web app path for Websphere Commerce can be
shortened. Search engines don't like long URLs. So, I don't like it
too!!! Lets see how we can reduce the URL length.
2 brains is much better than 1 brain!! My motto has always been to discuss and find better ways before implementing. This has really served me well. This thought and implementation came from my good buddy Mike !! Here is how he told me how to do it.
Simple and Straight forward Redirect rules through the IBM Http Servers
Inside your httpd.conf file of IBM Http Server. Do the following.
<VirtualHost <httpServerName>:80>
RewriteEngine On
RewriteCond %{REQUEST_METHOD} ^TRACE
RewriteRule .* - [F]
RewriteRule /SHORTENED_WEBAPP_NAME/(.*) /webapp/wcs/stores/servlet/$1 [PT]
</VirtualHost>
<VirtualHost <httpServerName>:443>
RewriteEngine On
RewriteCond %{REQUEST_METHOD} ^TRACE
RewriteRule .* - [F]
RewriteRule /SHORTENED_WEBAPP_NAME/(.*) /webapp/wcs/stores/servlet/$1 [PT]
</VirtualHost>
Doing this will replace your /webapp/wcs/stores/servlet/ webapp path to /SHORTENED_WEBAPP_NAME/
Explanation of the bold Rewrite rule.
The () puts whatever is wrapped within it into memory.You can then access what’s been stored in memory with $1 (i.e., what is in the first set of parentheses).
The PT (Pass Through) flag on the RewriteRule is what allows the WebSphere plug-in to process the rewritten URL.
References
1. PDF - Search Engine Rules & References about the above redirect rule. Page 257 .
2. Pass Though Flag [PT] details
2 brains is much better than 1 brain!! My motto has always been to discuss and find better ways before implementing. This has really served me well. This thought and implementation came from my good buddy Mike !! Here is how he told me how to do it.
Simple and Straight forward Redirect rules through the IBM Http Servers
Inside your httpd.conf file of IBM Http Server. Do the following.
<VirtualHost <httpServerName>:80>
RewriteEngine On
RewriteCond %{REQUEST_METHOD} ^TRACE
RewriteRule .* - [F]
RewriteRule /SHORTENED_WEBAPP_NAME/(.*) /webapp/wcs/stores/servlet/$1 [PT]
</VirtualHost>
<VirtualHost <httpServerName>:443>
RewriteEngine On
RewriteCond %{REQUEST_METHOD} ^TRACE
RewriteRule .* - [F]
RewriteRule /SHORTENED_WEBAPP_NAME/(.*) /webapp/wcs/stores/servlet/$1 [PT]
</VirtualHost>
Doing this will replace your /webapp/wcs/stores/servlet/ webapp path to /SHORTENED_WEBAPP_NAME/
Explanation of the bold Rewrite rule.
The () puts whatever is wrapped within it into memory.You can then access what’s been stored in memory with $1 (i.e., what is in the first set of parentheses).
The PT (Pass Through) flag on the RewriteRule is what allows the WebSphere plug-in to process the rewritten URL.
References
1. PDF - Search Engine Rules & References about the above redirect rule. Page 257 .
2. Pass Though Flag [PT] details
No comments:
Post a Comment