`My grails application is deployed under the ROOT context in Tomcat 7.0.32 running on Debian Stable. I enabled this by setting apache-tomcat-7.0.32/conf/Catalina/localhost/ROOT.xml:
<?xml version="1.0" encoding="UTF-8"?>
<Context path="" docBase="/home/tomcat/explodedWarDirectory/" antiResourceLocking="false" privileged="true" />
When the Grails g:link tag is evalutaed or a redirect() from a controller is invoked, all URLs contain // at the beginning, presumably because the context is empty.
So, I changed the above configuration to <Context path="/" but still have the same problem.
How can I get the link or redirects working correctly so I don’t have // at the beginning of my URLs?
I’ve resolved this, thanks to Andrew in the comments.
In
grails-app/conf/Config.groovyI had a trailing slash for the server’s URL (in our production section):grails.serverURL = "http://ourhostname/"Removing the trailing slash resolved it.