Questions tagged [trailing-slash]

A slash sign at the end of a URL.

A slash sign at the end of a URL.

263 questions
0
votes
2 answers

Redirect URLs with a trailing slash to URLs with no trailing slash via htaccess rule with [QSA,L]

Recently I broke ties with WordPress and migrated all of my site's content to my own custom-made CMS. All works great except for one thing. All previous links to my site's blog posts have a trailing slash. Since none of my current URLs have a…
SLV
  • 21
  • 1
  • 5
0
votes
1 answer

.htaccess: Redirect Trailing Slashes

I have a rewrite rule below in my .htaccess file in the root directory: RewriteEngine On # Exclude .css / .js / ... RewriteCond ${REQUEST_URI} ^.+$ RewriteCond %{REQUEST_FILENAME} \.(gif|jpe?g|png|js|css|swf|php|ico|txt|pdf|xml)$ [OR] RewriteCond…
Vahid
  • 3,384
  • 2
  • 35
  • 69
0
votes
0 answers

What difference '/' makes if it appears at the end of the URL

I want to understand what difference / makes in the URL, for example: http://localhost:8080 http://localhost:8080/ Basically I have installed Apache Tomcat, and access these URLs. Can anyone help me in understanding in simple words what difference…
CuriousMind
  • 8,301
  • 22
  • 65
  • 134
0
votes
3 answers

MySQL REGEXP with word boundary after forward slash

I have some URLs without http:// in a database table: url row #1: 10.1.127.4/ row #2: 10.1.127.4/something Now, the following filter gives me row #2 - fine: SELECT * FROM mytable WHERE url REGEXP '[[:<:]]10.1.127.4/something[[:>:]]' But the…
Anse
  • 1,573
  • 12
  • 27
0
votes
1 answer

htaccess redirect nestings causes trouble - trailing slash needed

I have some rules in my htacces, everything by learning by doing with the help of stackoverflow and other sites. But now I wanted to add a rule for adding a trailing slash to urls without a suffix (to pretend duplicate content), the trouble starts -…
0
votes
2 answers

Vanity URLs without trailing slashes on Nginx

With some help from @jon-lin, we figured out how to remove trailing slashes on Apache (Vanity URLs without trailing slashes on Apache); now, as we plan to run our site on Nginx, we'd like to do the same. We tried several suggestions we found on…
haadaa
  • 87
  • 11
0
votes
1 answer

Add a trailing slash on URL (Expression Engine)

Hi guys trying to add a trailing slash www.example.com/ to all of the URLs on may site that don't have one via htaccess or similar method that works with the Expression Engine CMS. Any ideas. Below is my current htaccess - I've tried a few…
Trent
  • 429
  • 1
  • 5
  • 19
0
votes
1 answer

Local static server without trailing slash

What's the simplest way to run a static server without trailing slashes locally? Ideally, I'd simply like to only use tools that come installed with the latest version of OS X. Unfortunately, python -m SimpleHTTPServer 8000 and ruby -run -ehttpd .…
ma11hew28
  • 121,420
  • 116
  • 450
  • 651
0
votes
1 answer

Removing trailing slash from URL using PHP

What I need: example.com/webpage/ should redirect to example.com/webpage I am using: $path = $_SERVER['REQUEST_URI']; if(substr($path, -1) == '/') { $path=rtrim( $path, '/\\' ); header("Location: $path"); } The problem: When someone…
0
votes
1 answer

Is it okay to add parameters to a URL after a trailing slash

For example: http://www.example.com/dashboard/?utm_source=mySource&utm_medium=Mobile&utm_campaign=myCampagin My goal is to add Analytics tags to all the links in my site.
fran
  • 326
  • 3
  • 15
0
votes
1 answer

AngularJS with ui.router: parameter in URL interpreted as path if trailing slash

In my AngularJS app with ui.router the parameter in the URL is interpreted as path if there is a trailing slash. What works: http://example.com/product/123 What does not work: http://example.com/product/123/ In the console I see that AngularJS is…
user2113177
  • 350
  • 3
  • 16
0
votes
1 answer

.htaccess Force Trailing Slash Rewrite

Apologies but I'm fairly new to URL Rewrites. I've managed to get the rewrite working in the conventional sense but cannot force it to have a trailing slash. Here is the code: RewriteEngine On RewriteCond %{REQUEST_FILENAME} !-f RewriteCond…
0
votes
2 answers

Reviews in Magento don't work after changing .htaccess

I need help. My store is running on Magento CE 1.9 and I wanted either add trailing slash to all my urls in Magento, or to get rid of it. Adding trailing slash didn't work, because some images and other linked files didn't want to load, so I added…
0
votes
1 answer

htaccess add trailing slash if there isn't one

Below is my current htaccess file. It's set up to allow for no extensions and to 301.php and .htm to no extension. I also need to add trailing slashes whenever there isn't one. There are plenty of topics on here answering that question but I can't…
sarah3585
  • 637
  • 13
  • 37
0
votes
1 answer

Rewrite trailing slash at a html page

I've been working on my website for a while and recently have com up to the errors I get if I got to a url with a / after it for instance a directory http://parabolah.cf/documentation/ that would normally forward you to another page doesn't or a…