Please upgrade here. These earlier versions are no longer being updated and have security issues.
HackerOne users: Testing against this community violates our program's Terms of Service and will result in your bounty being denied.
Am using CakePHP, how can I remove /app/webroot/ in all my links?
tried many things.. and $Configuration['Garden']['WebRoot'] doesn't seem to work.
Tagged:
0
Answers
grep is your friend.
grep is your friend.
grep is your friend.
in wordpress there is a field which you can input the webroot, which can also be changed in the database..
simply in libary/core/class.request.php find
$this->_EnvironmentElement('ConfigStrips', Gdn::Config('Garden.StripWebRoot', FALSE))
replace it with
$this->_EnvironmentElement('ConfigStripUrl', Gdn::Config('Garden.StripWebRoot', FALSE))
config like so
$Configuration['Garden']['WebRoot'] = 'path/to/web/app';// you want to strip note no preceding or trailing slash. $Configuration['Garden']['StripWebRoot'] = TRUE;
grep is your friend.
grep is your friend.
public function WebRoot($WebRoot = NULL) { $Path = (string)$this->_ParsedRequestElement('WebRoot', $WebRoot); $WebRootFromConfig = $this->_EnvironmentElement('ConfigWebRoot'); $RemoveWebRootConfig = $this->_EnvironmentElement('ConfigStripUrls'); if ($WebRootFromConfig && $RemoveWebRootConfig) {//strip code //don't worry about trailing preceding slashes/spaces $WebRootFromConfig = trim($WebRootFromConfig,'/ '); //case insensitive strip, once and from the beginning $Path = preg_replace('#^'.$WebRootFromConfig.'#i', '', $Path); } return $Path; }
if you change the directory structure remember to clear the cache
grep is your friend.
It could also be possible to auto strip, which would make it more transportable.
grep is your friend.