relative-path

Including a PHP file, treats relative URLs from that directory.

I have a PHP file at my server root.. index.php .. which include's .. DIR/main.php Now .. DIR/main.php .. include's many nearby PHP files using relative URLs using .. include("./common1.php"); Any way I can change the relative-URL base path so when including "DIR/main.php" It can relatively access its nearby PHP files like "DIR/common...

What does the dot-slash do to PHP include calls?

A. What does this do? require ("./file.php"); B. in comparison to this? require ("file.php"); (Its not up-one-directory.. which would be) require ("../file.php"); ...

Change relative link paths for included content in PHP

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 DI...

Having a lot of trouble deploying a java applet

I'm new to Java. I'm simply trying to build a .jar file of my applet so I can run it from my browser. This is what my directory structure looks like: C:\java\pacman\src contains all of the .java class files. C:\java\pacman\assets contains about 4-5 images and audio files. If I try to use the following code: Image someFile=getCod...

How to Relocate Visual Studio project (.sln) file

I would like to move the Visual Studio solution (myProject.sln) file into a folder. The problem with doing this is that all the relative paths in the project will break, how can you relocate the project without updating all relative paths inside the project manually? Thanks. ...

Need a http server with some specific criteria

Hi everyone, I've been looking for a webserver for my project but I haven't been able to satisfy myself. I need a http server that has support for compiled CGI scripts (exe), for Windows, and must be able to use relative paths. It would be a bonus if the server could be a minimal/lightweight as possible. The hardest part in my search th...

Include relative files in PowerShell

I would like to include script files with such pseudo syntax: Include '.\scripA.ps1' But the only thing I have found is some thing like this: $thisScript = Split-Path -Path $MyInvocation.MyCommand.Definition -Parent . ($thisScript + '.\scriptA.ps1') that is ugly. Is there some nice way to include scripts with relative paths? ...

Why am I getting absolute urls in Satchmo when I upload product images locally?

I'm doing some local development using Django and Satchmo. When I upload product images locally via the admin, the path to the image shows up as an absolute path, complete with drive letter, rather than the proper relative path. Stranger still, Satchmo saves both the original image and the thumbnails it generates in both me /media/ dir...

Relative path to SQLite DB in context.xml

Is it possible to use a relative path to an SQLite database file in the context.xml file of a Java web application? At present, I have: <?xml version="1.0" encoding="UTF-8"?> <Context path="/mywebapp"> <Resource name="jdbc/mydb" auth="Container" type="javax.sql.DataSource" maxActive="100" maxIdle="30" maxWait="10000" ...

Perl Script Configuration and Relative Path Implementation on both Windows (XP) / Unix (Solaris)

Heylo, I'm experiencing, somewhat of, a conundrum regarding perl script development. I have written a small Perl script using the standard (basic) Perl installation. I have the following setup: C:\MyScript\perl.pl C:\MyScript\configuration\config.ini C:\MyScript\output\output.txt This is the perl.pl source: $config = '/configu...

Safe version of Path.Combine

I have a rootPath that I trust and a relativePath that I don't. I want to combine them in such a way that I can be sure that the result is under rootPath and that the user can't use .. to get back past the starting point. I do want the relative path to allow things like: hello\..\world == world ...

Custom 404 pages not being able to postback due to relative path issues

My site currently implements custom 404 pages which we have mapped in IIS. So when a user does something like www.mysite.com/foo/bar/doesnotexist, it will execute the 404.aspx URL. This works great, but when inspecting the HTML returned, the form post URL is relative: <form method="post" action="404.aspx?404%3bhttps%3a%2f%2ftestserver...

Is there a .net library for parsing relative web addresses?

I am writing a search engine (why not hey?) and need to handle navigating relative urls such as "../about.aspx", "/about.aspx" "about.aspx" etc Is there anything out there or in the .Net Library's which can convert these to absolute addresses? ...

~/ equivalent in javascript

any smart way of doing a "root" based path referencing in javascript just the way we have ~/ in asp.net ? ...

Execute with Ant works with absolute path but not relative path

I have the following snippet in my Ant script. It executes just fine: <exec executable="C:\test\foo\programName.exe" /> But then when I try to execute it by setting the directory, like so: <exec executable="programName.exe" dir="C:\test\foo\" /> I get: Execute failed: java.io.IOException: Cannot run program "programName.ex...

Absolute and Relative problem in .htaccess (mod_rewrite)

Hi I am new to .htaccess and mod_rewrite. I am using the following Rewrite rules : RewriteRule ^wants/([0-9]+)$ /wantlist.php?wantid=$1 RewriteRule ^dashboard$ /dashboard.php I am able to successfully redirect both the cases. But in order to do this, I had to change the css, js and other paths to absolute paths without which the ...

Ruby path management

What is the best way to manage the require paths in a ruby program? Let me give a basic example, consider a structure like: \MyProgram \MyProgram\src\myclass.rb \MyProgram\test\mytest.rb If in my test i use require '../src/myclass' then I can only call the test from \MyProgram\test folder, but I want to be able to call it from any ...

Relative paths in Python

I'm building a simple helper script for work that will copy a couple of template files in our code base to the current directory. I don't, however, have the absolute path to the directory where the templates are stored. I do have a relative path from the script but when I call the script it treats that as a path relative to the current w...

Problem using URL rewrite (Relative Paths not working)

Hi I am using a .htccess file in order to rewrite my URLs. I am using the following rules in my .htaccess files Options +FollowSymlinks RewriteEngine on RewriteBase / RewriteRule ^product/([0-9]+)/([A-Za-z0-9+]+)$ /product.php?productid=$1&prodname=$2 The rewrite worked fine. But when i try to access any other page through relative...

Relative file paths in Python packages

How do I reference a file relatively to a package's directory? My directory structure is: /foo package1/ resources/ __init__.py package2/ resources/ __init__.py script.py script.py imports packages package1 and package2. Although the packages can be imported by any other script on the syste...