Questions tagged [relative-path]

Relative-paths are URI or directory links to resources that refer to a location relative to the current path.

A relative path references a resource in relation to a current path or directory; its opposite is an absolute path. Web pages frequently make use of relative paths to refer to resources like images and scripts. The advantage of using a relative path is that it remains valid when the host name or root path changes.

As an example, consider a website located at the URL:

http://www.hostname.com/site/page.html

If the page wants to reference an image located at:

http://www.hostname.com/site/images/image.jpg

It could simply make reference to the relative path images/image.jpg.

2470 questions
12
votes
1 answer

How do imports work in IPython

I'm a little bewildered by exactly how import statements work in IPython. I've turned up nothing through web searches. Implicit relative imports work with Python 2, but I don't know if that's still the case with IPython for Python 3. Relative…
orodbhen
  • 2,644
  • 3
  • 20
  • 29
12
votes
6 answers

Execute scripts by relative path in Oracle SQL Developer

First, this question relates to Oracle SQL Developer 3.2, not SQL*Plus or iSQL, etc. I've done a bunch of searching but haven't found a straight answer. I have several collections of scripts that I'm trying to automate (and btw, my SQL experience…
Didjit
  • 785
  • 2
  • 8
  • 26
12
votes
2 answers

How do I create root-relative links in a static site?

When building a static HTML site, you can set the base url like so . Supposedly when you insert, say, an image, you can do so from that base url like so , which is equivalent to…
sea_monster
  • 659
  • 3
  • 8
  • 18
11
votes
3 answers

FOP: how to specify image src relative path?

This is my first question here, i hope i'm doing it right. Sorry for my bad English in advance :) I am using JSF 2.0 (Eclipse IDE) and i'm trying to generate some PDF files using Apache FOP 1.0. I was able to make simple PDF files using instructions…
Nikola
  • 283
  • 2
  • 4
  • 11
11
votes
2 answers

Using (relative) paths to shortcut in include statements in C++

I started coding in C++ few days ago. I am using windows as my OS for writing code. I have been keeping all of my "well-written" codes in a single location. Now, I am working on a project that requires the use of those codes. So, I planned to…
Python_user
  • 1,378
  • 3
  • 12
  • 25
11
votes
4 answers

Absolute URL from base folder with rewrite

I have a project running local on WampServer. It's an MVC-like structure; it rewrites the URL to index.php?url=$1. Full .htaccess: RewriteEngine On RewriteCond %{REQUEST_FILENAME} !-d RewriteCond %{REQUEST_FILENAME} !-f RewriteCond…
11
votes
1 answer

How to open a file with relative path in C++?

I am writing test cases right now and I created some test files which I try to read. The absolute path is: /home/user/code/Project/source/Project/components/Project/test/file.dat but testing with an absolute path is bad for obvious reasons. So I…
Peter111
  • 803
  • 3
  • 11
  • 21
11
votes
2 answers

Forbidden location when using alias in nginx for relative urls

I am trying to set up roundcube / phpldapadmin / ... with Nginx on relative urls, e.g.: example.com/roundcube example.com/phpldapadmin The source are in the following folders: /var/www/roundcube /usr/share/phpldapadmin Everything was working fine…
Holt
  • 36,600
  • 7
  • 92
  • 139
11
votes
2 answers

How to use a relative path for LDFLAGS in golang

I am trying to build a golang program which uses a static lib (.a file) the directory struct for my project as below └─testserver ├─bin ├─pkg └─src ├─logging └─testserver ├─libtest.a └─test.go the…
catric mia
  • 1,137
  • 2
  • 9
  • 8
11
votes
10 answers

Why is Magento 1.4 including javascript files by filesystem path?

I am in the process of testing a Magento 1.3 site using Magento 1.4. I am seeing very weird and inconsistent behavior. Instead of including the URL of my javascript files, Magento is creating tags with the full filesystem path of the js files, as…
Josh
  • 10,961
  • 11
  • 65
  • 108
11
votes
1 answer

Enforce trailing slash in Rails Routing

Adding a trailing slash in your links is easy enough with {:trailing_slash => true}, but this doesn't account for if a user types in a non-slashed url. Is there a way to enforce trailing slashes via redirects in the router? get "/:controller/:id"…
trevorgrayson
  • 1,806
  • 1
  • 21
  • 29
11
votes
2 answers

Are protocol-relative URLs relative URLs?

So consider a protocol-relative URL like so; //www.example.com/file.jpg The idea I've had in my head for as long as I can remember is that protocol-relative URLs are in fact absolute URLs. They behave exactly like absolute URLs, and never do they…
Emphram Stavanger
  • 4,158
  • 9
  • 35
  • 63
11
votes
3 answers

Java- relative path of text file in main?

I was wondering how to specifiy a relative path name to a text file that is stored in my src folder of a java project. I would like to store a string with the path of this text file. For example if I had example.txt located in the src folder of my…
zProgrammer
  • 727
  • 4
  • 10
  • 22
11
votes
2 answers

How can I use relative paths to external response files for soapUI MockService

What I've Done I am using soapUI (3.6.1 Free version) mock services to serve up specific data to 2 client applications I am testing. With some simple Groovy script I've set up some mock operations to fetch responses from specific files based on the…
Mark
  • 113
  • 1
  • 1
  • 7
11
votes
3 answers

Send redirect to relative path in JSP?

response.sendRedirect("../seja/izpisknjig.jsp"); the file in which I execute this line is index.jsp. the directory structure looks like this. project --index.jsp seja --izpisknjig.jsp How do I form the relative path to redirect to izpisknjig.jsp.
Borut Flis
  • 15,715
  • 30
  • 92
  • 119