relative-path

Absolute vs Relative Links : Technical Difference

被刻印的时光 ゝ 提交于 2019-12-02 09:26:35
Which is better option or there is no difference in terms of speed or other issues like SEO, Backlinks href="http://www.example.com/contact" href="../../contact" From what i observe, Absolute paths uses paths from left to right finally move to rightmost position as in http//www.example/contact fpr relative paths: first it gets the current location, then based ../../contact or ../blog/articles move there. Technically which is faster, as mentioned in answers speed difference is ignorable/minute. But how it works Jukka K. Korpela There is no (measurable) difference in speed or anything as regards

how to grab the relative path of a file with php

Deadly 提交于 2019-12-02 07:47:09
i am trying to catch the relative path to a file to create a share link. From my httpdocs folder on the webserver, my file is here: jack/single/uploads/folder1/image.jpg The var $dir . '/' . $file gives me this output: uploads/folder1/image.jpg realpath($dir . '/' . $file gives me this output: /home/vhosts/example.com/subdomains/develop3/httpdocs/jack/single/uploads/folder1/image.jpg What i want to achieve is this output: `http://develop3.example.com/jack/single/uploads/folder1/image.jpg` How can i achieve this, so that i can create a share link? You could use preg_replace on the output of

How to specify path to Image resources in WPF application

北城以北 提交于 2019-12-02 07:45:13
Below is in a flow document I can see all 5 in design When I run the program then none are found How can I get relative path to work? <Paragraph> <Image Width="50" Height="50" Source="zHelpMain.png" Stretch="Fill"/> </Paragraph> <Paragraph> <Image Width="50" Height="50" Source="Images\VennIntersection.png" Stretch="Fill"/> </Paragraph> <Paragraph> <Image Width="50" Height="50" Source="/Gabe2a;component/Images/VennUnion.png" Stretch="Fill"/> </Paragraph> <Paragraph> <Image Width="50" Height="50" Source="/Images/helpMain.png" Stretch="Fill"/> </Paragraph> <Paragraph> <Image Width="50" Height="50

Change relative link paths for included content in PHP

六月ゝ 毕业季﹏ 提交于 2019-12-02 07:37:12
I have a PHP file at my server root.. index.php .. which include 's .. DIR/ main.php Now .. DIR/ main.php .. has relative links to many nearby files. All the relative links are broken. Any way I can change the relative-URL base path for links? ... so the included content of DIR/ main.php has all its links to friend1.php changed to DIR/friend1.php . Edit: This in NOT about include's, this is about CHANGING ahref links en-masse. The base tag in html works for relative links. See w3schools for an example on how to use it. Assuming main.php is a mix of HTML and PHP then when you output a link you

Get relative path to a parent directory

只愿长相守 提交于 2019-12-02 07:13:36
问题 I have a scenario where I want to get a path back to a specific parent directory. Here is an example folder strcuture ( [something] is a folder) index.php [components] header.php footer.php [pages] somePage.php [somePageSubPages] someSubPage.php So my content pages look something like this: <?php include('components/header.php'); ?> <!-- CONTENT STUFF --> <?php include('components/footer.php'); ?> This works for the index.php but not for somePage.php and someSubPage.php . What I want to do is

Safe cross-platform function to get normalized path

橙三吉。 提交于 2019-12-01 18:20:05
I'd like to have a standard function that will convert relative paths into absolute ones, and if possible I'd like to make it as cross-platform as possible (so I'd like to avoid calling external library functions). This is intended so it's possible to prevent path exploitations. I am aware that such a function wouldn't be able to detect symbolic links, but I'm ok with that for my application. I could roll my own code, but there might be some problems with e.g. how a platform handles encoding or variations of the "../" pattern. Is there something like that already implemented? Adam Rosenfield

Checking for relative vs absolute paths/URLs in PHP

Deadly 提交于 2019-12-01 15:23:19
问题 I need to implement functions to check whether paths and urls are relative, absolute, or invalid (invalid syntactically- not whether resource exists). What are the range of cases I should be looking for? function check_path($dirOrFile) { // If it's an absolute path: (Anything that starts with a '/'?) return 'absolute'; // If it's a relative path: return 'relative'; // If it's an invalid path: return 'invalid'; } function check_url($url) { // If it's an absolute url: (Anything that starts with

Rails 4 Javascript: Having trouble with image paths

╄→尐↘猪︶ㄣ 提交于 2019-12-01 13:55:28
问题 I'm trying to get the background image to change every 6 seconds and it's always a 404 error: For example, the below appears in the JS console http://localhost:3000/app/assets/images/ggb_mist.png 404 (Not Found) To simplify this I just tried a background-color to make sure it was working. See below: $(document).ready(function() { function testing() { $('.holder').css('background-color', 'red'); }; }); The above works. Now when I try to do the same with an image (which is located in app/assets

Bitnami: How to configure GitLab 5.0 application in Apache2 not to have relative root?

笑着哭i 提交于 2019-12-01 12:50:01
问题 (Or how to make GitLab application as root application on Apache2 HTTP server. ) I have not used Apache2 before, but I got Bitnami GitLab VM with preinstalled server. I and run into issues, because application root is relative. Bitnami GitLab 5.0 and git & Eclipse EGit quick start The fix is to not using relative root, but run GitLab application as root on Apache2 HTTP server. I have found configuration files location using Bitnami wiki for Apache component: 1) /opt/bitnami/apache2/conf/httpd

How do I make these relative imports work in Python 3?

戏子无情 提交于 2019-12-01 11:12:10
I have a directory structure that looks like this: project/ __init__.py foo/ __init.py__ first.py second.py third.py plum.py In project/foo/__init__.py I import classes from first.py , second.py and third.py and put them in __all__ . There's a class in first.py named WonderfulThing which I'd like to use in second.py , and want to import by importing * from foo . (It's outside of the scope of this question why I'd like to do so, assume I have a good reason.) In second.py I've tried from .foo import * , from foo import * and from . import * and in none of these cases is WonderfulThing imported.