SunOne obj.conf friendly urls - redirect /index.jsp -> /

177 views Asked by At

We're old school. We still use SunOne 6.1.

I cannot seem to get anything to register on my local machine when making modifications to the obj.conf file on my local machine (windows). Is the behavior different for windows machines then unix machines?

More specifically we are trying to redirect /index.jsp pages to the parents folder for more friendly URLS. For example:

https://cooldomain/awesome/index.jsp -> https://cooldomain/awesome/

Currently you can hit both, which is causing SEO issues as google sees them as two pages with the same content.

Another odd windows/unix item is on the windows machine (developer environment) the url gets forced to index.jsp. For instance if I go to https://cooldomain/awesome/ it forces me to -> https://cooldomain/awesome/index.jsp

I am making simple changes in the OBJ.conf file locally to try and solve the above issue, specifically for testing I am putting in a redirect like so:

NameTrans fn="redirect" from="/amazing" url="http://domain.com/amazing/feature"

and it will just pull up http://domain.com/amazing

Anyone have insight on this legacy system?

1

There are 1 answers

0
stu On

If you hit a nametrans redirect it does it, I think you have to filter out urls that you want to bypass the nametrans....

<If $path =~ 'index.jsp'>
  NameTrans fn="redirect" url="http://domain.com/amazing/feature"
</If>

So you're only doing the redirect if you hit the index.jsp page.