slash

Echo A Link, Get A Trailing Slash?

I've discovered that any time I do the following: echo '<a href="http://" title="bla">huzzah</a>'; I end up with the following being rendered to the browser: <a href="http:///" title="bla">huzzah</a> This is particularly annoying when I link to a file with an extension, as it breaks the link. Any ideas why this is happening and ho...

How can I escape the slash character in vi?

When I try to search a string starting with the slash / character in vi, the cursor jumps to the next search result from the previous search. However, I'd like to find the literal slash character. How can this be done? ...

How to remove extension and force trailing slash with .htaccess

I managed to solve this problem by the following code: RewriteCond %{REQUEST_FILENAME} !-d RewriteCond %{THE_REQUEST} ^GET\ /[^?\s]+.php RewriteRule (.*).php$ /$1/ [L,R=301] RewriteCond %{REQUEST_FILENAME} !-d RewriteRule (.*)/$ $1.php [L] RewriteCond %{REQUEST_FILENAME}.php -f RewriteRule .*[^/]$ $0/ [L,R=301] In other words, no...

So what IS the right direction of the path's slash (/ or \) ?

it seems windows insist on writing this slash on files' path \, while .net's URI class writing this the other way? Is there any right way? that is accepted even in the most primitive systems? And why the .net's URI is showing the other slash than windows does? Thanks. ...

Allow param containing slashes in Zend_Controller_Router_Route_Regex

This is my code: $route = new Zend_Controller_Router_Route_Regex('download/([^/]+)(/([^/]+))?/(\d+)/(\d+)', array('controller' => 'download', 'action' => 'load'), array(1 => 'name', 3 => 'or_name'...

Is a slash ("/") equivalent to an encoded slash ("%2F") in the path portion of an HTTP URL

I have a site that treats "/" and "%2F" in the path portion (not the query string) of a URL differently. Is this a bad thing to do according to either the RFC or the real world? I ask because I keep running into little surprises with the web framework I'm using (Ruby on Rails) as well as the layers below that (Passenger, Apache, e.g., ...

Trailing slash and initial www

I have this htaccess: RewriteEngine On # redirect with www RewriteCond %{HTTP_HOST} ^mydomain [NC] RewriteRule ^(.*)$ http://www.%{HTTP_HOST}/$1/ [R=301,L] # add .php internally RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{REQUEST_FILENAME} !-d RewriteRule ^(.*)$ $1.php [L,QSA] So my .php files can be called wit...

JavaScript removes slash from JSP variable

Have JSP variable ${remoteFolder} It's value is \\file-srv\demo Use jQuery embedded in this JSP. jQuery resolves ${remoteFolder} variable as \file-srvdemo ,i.e. one slash is removed. How to remain initial value of this var? edited: when ${remoteFolder} is used inside form tag, that it resolved OK. edited2: JS part of JSP, slashes ...

R slash - escape oder sanatize using regex?

Hi there I've just started analyzing some data using R - unfortunately I have encountered some problem... I'm reading in a (tab separted) csv file and want to process the data and there is one attribute I am particularly interested (which certainly exists within this csv). This is called: data_transfer.Jingle/TCP.total_size_kb Now when ...

Adding a trailing slash after url moves the box below the menu & logo over it

I am using codeigniter. My products page shows all the products we have and then users can click on each product_name to get more details about that particular product. So, I have declared products as the class and product_name as a function within the product class - so I could get the url www.company.com/products/product_name. When I...

nginx and trailing slashes on $document_root?

I use the following configuration for nginx: http://gist.github.com/340956 However, this configuration causes a No input file specified error with PHP. The only way I have been able to solve it is by altering this line: fastcgi_param SCRIPT_FILENAME $document_root/$fastcgi_script_name; Note the "/" between $document_root and $fast...

making apache and django add a trailing slash

Hello. My /train directory is aliased to a script in httpd.conf by: WSGIScriptAlias /train /some-path/../django.wsgi And it works well, except for one problem. If a user goes to /train (with no trailing slash) it will not redirect him to /train/, but will just give him the right page. This is a problem because this way the relative lin...

How to create a JAX-RS service where the sub-resource @Path doesn't have a leading slash

I've created a JAX-RS service (MyService) that has a number of sub resources, each of which is a subclass of MySubResource. The sub resource class being chosen is picked based on the parameters given in the MyService path, for example: @Path("/") @Provides({"text/html", "text/xml"}) public class MyResource { @Path("people/{id}") publ...

How do I have a reverse proxy work with or without the trailing slash?

I have a apache web server that needs to reverse proxy a site. So example.com/test/ or example.com/test pull from the same other webserver. I have setup a reverse proxy for the one without the trailing slash like this: ProxyPass /test http://othersite.com/test ProxyPassReverse /testhttp://othersite.com/test But it doesn't work with ...

Correctly encode characters in a PHP mail form ("I'm" turns to be "I\'m")

Hello guys, I'm testing a PHP mail form, a very barebones one, found here: <?php if(isset($_POST['submit'])) { //The form has been submitted, prep a nice thank you message $output = '<h3>Thanks for your message</h3>'; //Deal with the email $to = '[email protected]'; $subject = 'you...

Double Slash at end of URL when going to HTTPS?

My site currently uses http and https sections based on the data being collected on the site (form data uses https). On my index page, I have the PHP code at the top: <?php session_start(); ob_start(); if( $_SERVER['SERVER_PORT'] == 443) { header('Location:http://'.$_SERVER['HTTP_HOST'].dirname($_SERVER['PHP_SELF'])...

remove multiple trailing slashes mod_rewrite

I know this question was asked a number of times on this site alone, but browsing through the relevant posts I couldn't find a solution. Trying to remove multiple trailing slashes after domain. The following mod_rewrite expressions seem to work for URLs such as http://www.domain.com//path1///path2////, but do not work for domain// Direc...

how to escape slashes in perl text used in a regular expression?

end_date=$(date +"%m/%d/%Y") /usr/bin/perl -pi -e "s/_end_date_/${end_date}/g" filename I want to replace string '_end_date_' with current date. Since current date has slashes in it(yes I want the slashes), I need to escape them. How can I do this? I've tried several ways like replacing slashes with "\/" using sed and perl itself but ...

Escaping slash in Postgresql

I'm trying to write an sql function in Postgresql that will parse a file path. I want to return just the file name. I cannot get past getting an accurate text string in the function. Here is the function: Function: job_page("inputText" text) DECLARE $5 text; BEGIN $5 = quote_literal("inputText"); return $5; END When I run this: sele...

How to escape forward slash in T-SQL 2005?

I've got this dynamic t-sql: declare @sql nvarchar(max) set @sql = N' insert into #t SELECT row_number() over(order by getdate()) as RowNum, d.value('''+@baseDateXpath+''', ''datetime'') as basedate, pref.query(''.'') as XmlExtract FROM @content.nodes(''/*/*'') AS extract(pref) CROSS APPLY @content.nodes(''//*'') AS ...