Textpattern CMS support forum
You are not logged in. Register | Login | Help
- Topics: Active | Unanswered
Pages: 1
#1 2011-10-09 10:41:46
- zerokilled
- New Member
- From: Isla del Encanto, Borinquen
- Registered: 2011-10-04
- Posts: 6
overall site url, undesired behaviour
hello people!
first some backgrounds. i post the topic here mainly because i would like to know where in the source code i should look into so i can modify my copy of txp. second, my installation of txp is working fine, but read on. and third, i couldn’t find a better place for this topic. i also looked on the faq but result were unrelated.
i have installed txp (4.4.1v r3575) on a local computer with easyphp for development purpose. i managed to configure apache —and the router, just for clarification— for listening outside world http request and it work correctly. i just needed this to perform w3c validation. however, i noticed that txp generate absolute paths for urls according to the path provided in “Site URL” preference. isn’t an actual problem but is an undesired behaviour because i have to specify the ip address as the “Site URL”, so that all resources can be loaded correctly over my ip address. problem is, when i switch to work with local ip —that is, 127.0.0.1— but not being set in the preferences, all the request are sent to my isp and then back to me. which for me is unreasonable, due to unnecessary traveling of request. is easy to fix just by setting the local ip in preference, but it become annoying going back and forth setting such preference. keep in mind that a domain name —as far as i know— wouldn’t help.
it was an unforeseen behaviour? any purpose for txp needs to generate full url paths? how i can change this behaviour so that i generate path without it’s top level domain? if it wasn’t a design decision, i would like to suggest for future version to generate path without top level domain, or at least to provide a preference for this.
any insight is welcome,
thanks for reading.
Last edited by zerokilled (2011-10-09 14:34:06)
How do you get to the past? Keep traveling west.
Offline
#2 2011-10-09 12:11:31
- zerokilled
- New Member
- From: Isla del Encanto, Borinquen
- Registered: 2011-10-04
- Posts: 6
Re: overall site url, undesired behaviour
well, i guess i managed to find the answer. just leave the “SiteURL” preference empty. txp automatically detect if is empty, then build the url according to host and directory name. at least that’s not described in the manual references, i thought it was required so i filled it. thanks anyway for reading.
How do you get to the past? Keep traveling west.
Offline
Re: overall site url, undesired behaviour
zerokilled wrote:
well, i guess i managed to find the answer. just leave the “SiteURL” preference empty. txp automatically detect if is empty, then build the url according to host and directory name. at least that’s not described in the manual references, i thought it was required so i filled it. thanks anyway for reading.
Yep. Site’s URL and site’s paths are optional in a sense that those are build automatically (URL if undefined, paths always). For example the path defined in config.php isn’t used for anything else than backwards compatibility with plugins.
Just note; when the site URL preference is left empty, the URL’s host part is taken directly form the header client browser sends. If you are not explicitly limiting to which host server answers, the host can be overwritten to anything by the visitor. Also the path isn’t clean either, it can be set to anything as long as the request ends up resolving to the correct location.
Keep in mind that the URL as a whole might not be safe, and you can not trust it blindly. It can contain path traveling or a domain that isn’t yours.
Offline
#4 2011-10-09 14:45:05
- zerokilled
- New Member
- From: Isla del Encanto, Borinquen
- Registered: 2011-10-04
- Posts: 6
Re: overall site url, undesired behaviour
thanks for the comment! at least the purpose isn’t intented for production. i needed those set up for easing some task while i’m debugging/developing in txp on an “offline environment”. however, when time come, i will take those precaution. again, thanks!
How do you get to the past? Keep traveling west.
Offline
Pages: 1