relative address vs absolute address - Printable Version +- GetSimple Support Forum (http://get-simple.info/forums) +-- Forum: GetSimple (http://get-simple.info/forums/forumdisplay.php?fid=3) +--- Forum: General Questions and Problems (http://get-simple.info/forums/forumdisplay.php?fid=16) +--- Thread: relative address vs absolute address (/showthread.php?tid=5385) |
relative address vs absolute address - vdonatiello - 2013-11-20 Hello, i wanted to add some images in the sidebar component ... i have not figured out how to use the relative address and i ended up using absolute address here is the prblem, for some reason, i have decided to change the webfolder name of my GetSimple website ... and now i need to update one by one these absolute addresses to the new address furthermore i have noticed that all the links in my navigation menu are not automatically updated ... if i click on the meny link it will send to the old webfolder ... do you have any suggestions? many thanks RE: relative address vs absolute address - Timbow - 2013-11-20 Images - It depends where you store the files. If the images are on flickr obviously you use an absolute url Code: http://www.flickr.com/... Code: http://www.mysite.com/data/uploads/.... Code: <?php get_site_url(); ?>data/uploads... Relative urls in the html are a 'no no' because the page does not exactly exist as an html file in a fixed location in the directory structure on the server. Nav links - sounds like you need to go to Settings in the Admin and enter the correct, new base url. RE: relative address vs absolute address - Everyone - 2013-11-21 As long as GS resides in root folder, it's safe to go with PHP Code: /data/uploads/<file> You can also edit /admin/settings.php, line 79 (GS 3.2.3) to have this Code: $SITEURL = tsl($_POST['siteurl']); Code: $SITEURL = '/'; RE: relative address vs absolute address - Carlos - 2013-11-22 IMO it's better to patch GS so that it allows entering a relative-to-root site url in settings ("/", "/folder/", ...) Edit /admin/settings.php and remove the type="url" in line 217 (GS 3.2.3) RE: relative address vs absolute address - Everyone - 2013-11-22 ^ yup, this is way better, and makes more sense from user's point of view. RE: relative address vs absolute address - vdonatiello - 2013-11-22 (2013-11-22, 01:16:56)Carlos Wrote: IMO it's better to patch GS so that it allows entering a relative-to-root site url in settings ("/", "/folder/", ...) hello, your suggestion applies only if GS in installed in the root folder i suppose ... if i have semething like mydomain/siteA, my domain/siteB, mydomain/GetSimple and i want to remane the GS webfolder and take advantages of portability of relative addresses ... do u still suggest that patch? many thanks RE: relative address vs absolute address - Everyone - 2013-11-22 You can't use Carlos' suggestion with your setup, unless you hack in core and dynamically add your host root to the $SITEURL global, but that's dodgy and may do more harm than good in the long run. If it's possible for you to create and use subdomains then I'd suggest creating those and pointing them to your subfolders. This way all your GS instances can be placed "at root" and you can safely use Carlos' suggestion. RE: relative address vs absolute address - vdonatiello - 2013-11-26 (2013-11-20, 19:33:41)Timbow Wrote: [...] i have used these suggestions and everything is fixed and i could easily rename the webfolder where GS is installed ... but there was a little problem i could not fix ... i have some pages, such as About Us for instance that i dodnt add in the menu (the horizontal navigation links) and i would like to call it from the footer ... the footer i think is considered a component of the template and i have added Code: <a href="<?php get_site_url(); ?>about-us" > but it does not work ... where is the mistake? many thanks RE: relative address vs absolute address - Timbow - 2013-11-26 I just tested it and it works for me so I don't know. Must be a typo or mistake somewhere. If you look at the link in your browser in View Source is it correct? and the page slug is 'about-us' ? RE: relative address vs absolute address - vdonatiello - 2013-11-26 (2013-11-26, 19:09:06)Timbow Wrote: I just tested it and it works for me so I don't know. Must be a typo or mistake somewhere. If you look at the link in your browser in View Source is it correct? and the page slug is 'about-us' ? my code inside footer.inc.php Code: <a href="<?php get_site_url(); ?>about-us" >About Us</a> this is the output from View Sorce Code: <div class="wrapper"> and this is the Edit Page "About Us" - Page Options: Code: Custom URL (Slug): thanks for helping RE: relative address vs absolute address - Timbow - 2013-11-27 I can see your pages and there seems nothing wrong with the link but when I click it I get a 404 Not Found which is not a GetSimple 404 and says Quote:The requested URL /fineplaces/index.php was not found on this server. what is /fineplaces/index.php ? How have you done that? It doesn't seem possible. RE: relative address vs absolute address - hameau - 2013-11-28 (2013-11-26, 23:46:12)vdonatiello Wrote: my code inside footer.inc.php Address rewriting is not working on your site, either because you don't have it turned on, or because the standard settings don't work on Apache v2.4, or your hosting provider has not enabled it in the Apache configuration. Make sure that you have something in (admin) Settings->Custom Permalink Structure (I would suggest %slug%) and clear the 'Use Fancy URLs' checkbox. Save settings. If that doesn't work, for quick results, change your footer code to this: Code: <a href="<?php get_site_url(); ?>index.php?id=about-us" >About Us</a> RE: relative address vs absolute address - Carlos - 2013-11-29 or (assuming about-us is a top level page with no parent): Code: <a href="<?php echo find_url('about-us',''); ?>">About Us</a> This way the link will (always) use the current custom permalink structure. RE: relative address vs absolute address - vdonatiello - 2013-12-03 (2013-11-28, 19:47:56)hameau Wrote:(2013-11-26, 23:46:12)vdonatiello Wrote: my code inside footer.inc.php thanks hameau, i have tried to add " %slug% " in the Custom Permalink Structure field and i made sure Use Fancy URLs is unchecked but it didnt work :-( thanks anyway RE: relative address vs absolute address - vdonatiello - 2013-12-03 (2013-11-29, 01:28:17)Carlos Wrote: or (assuming about-us is a top level page with no parent): dear Carlos, i don't understand PHP, i simply copied and pasted your suggestion and it works fine many thanks |