Questions tagged [trailing-slash]

A slash sign at the end of a URL.

A slash sign at the end of a URL.

263 questions
6
votes
1 answer

Angular 2 Adds Trailing Slash To URL With Multiple Router Outlets

I have an app component that has two outlets: template: '' I followed the example in this link to create the routing and the routerLinks and everything works fine as long as…
6
votes
1 answer

How to remove trailing slash from URL in nginx only if directory doesn't exist?

I am running a server on nginx 1.4.1 with PHP-FastCGI. Currently I have it setup so that it removes trailing slashes from my URLs and issues a 301 redirect. However, when I visit a directory that exists, I am forced into a redirect loop. My…
danronmoon
  • 3,814
  • 5
  • 34
  • 56
6
votes
3 answers

Removing trailing slash from ALL URLs in site

I'm kind of new to the whole .htaccess thing and I've been trying to modify it so that none of my links will have trailing slashes at the end of their respective URLs. My website is filmblurb.org. The code for the .htaccess where Wordpress begins…
jtarr523
  • 261
  • 1
  • 5
  • 16
5
votes
3 answers

Get request only works with trailing slash (spring REST annotations)

I have a Spring REST Controller: @RestController @RequestMapping(value = "/myresource") public class MyResourceController { ... } With a GET request method: @RequestMapping(method = GET, value = "/{value1}/{value2}/{value3}", produces =…
Nina
  • 681
  • 1
  • 10
  • 27
5
votes
1 answer

How to remove trailing slash for '/folder/index.html', when 'index.html' is stripped?

I have a static site with the following file/folder structure: index.html /foobar/ index.html bob.html alice.html I'd like to achieve the following: remove all .html extensions. ✔ works remove index.html (resp. index). ✔ works I want files to…
unor
  • 92,415
  • 26
  • 211
  • 360
4
votes
0 answers

Disable trailing slash redirect in next.js

I have some pages that are /hello.html and should not be changed and others that are /hello, and /hello/. In real life are a bit different, but I would like to don't redirect from /hello to /hello/ or viceversa. Each url is very specific and should…
Steve Mayers
  • 81
  • 1
  • 5
4
votes
1 answer

How to exclude trailing slash in a single route in Next.js?

I have a problem with Next.js Trailing Slash on some pages, I am using media query like: /test?type=something but with a trailing slash, I am getting /test/?type=something Is there any solution to remove the trailing slash on some specific pages?
Sarang Sami
  • 632
  • 1
  • 6
  • 13
4
votes
1 answer

CORS strange behaviour with trailing slash using React and Flask API

I'm currently building an application with React and a Flask API and I got some CORS errors I don't understand : I've got an endpoint like this : @app.route('/home/', methods=['GET']) def home(): response = Response( json.dumps( …
Nicolas Mauti
  • 506
  • 3
  • 13
4
votes
0 answers

Express adds a trailing slash to root path which breaks strict routing

I define my express endpoints using app.get or app.post This seemingly works but for the root directory a trailing slash is added when the html view is returned. The root view then becomes unavailable if enable strict routing on the app. const…
Dennis Bauszus
  • 1,624
  • 2
  • 19
  • 44
4
votes
1 answer

Removing the last slash of URL in XAMPP

I am currently working a project with PHP and Apache on a local server using XAMPP. I have an issue on my website, I was wondering if I can delete the last slash of my web URL. For example, I'm running a website in localhost and it was stored in…
Irvan Hilmi
  • 378
  • 1
  • 4
  • 16
4
votes
3 answers

Why redirects happens on missing of a trailing slash (/) from the URL ?

One of the most wasteful redirects happens when a trailing slash (/) is missing from a URL that should otherwise have one.For example, going to http://example.com/action results in a 301 response containing a redirect to http://example.com/action/…
4
votes
3 answers

Remove trailing slash in Google Analytics report

In Google Analytics, field Site Content report, I always receive two data about one link, one with slash and one non Like this: /post-one.html /post-one.html/ I want to receive only data of (/post-one.html), then I create a Search and Replace…
Charles
  • 51
  • 1
  • 5
4
votes
2 answers

Redirect to URL with trailing slash doesn't occur in Websphere 8.5.5

There is an application that works on WAS7. It has war module deployed on context path "Foo/Bar" (compound one). That is the war module is accessible via the URL like this: localhost:9080/Foo/Bar. Then I deployed the same application on WAS 8.5.5.…
Siarhei Vouchak
  • 125
  • 1
  • 10
4
votes
4 answers

How to add a trailing_slash to all urls without in Rails 4?

I've tried adding this in application.rb config.action_controller.default_url_options = { :trailing_slash => true } as well as having :trailing_slash => true in routes.rb match '/download', to: 'welcome#download', via: 'get', :trailing_slash =>…
Lucia
  • 13,033
  • 6
  • 44
  • 50
3
votes
1 answer

Remove trailing slash after directory with htaccess

I want to remove / when I want to get access to the index file in a subdirectory folder. For example: www.example.com/test/dashboard/ to www.example.com/test/dashboard. I tried this: RewriteEngine On # Remove "/" to "/dashboard" RewriteCond…
chris oojer
  • 301
  • 1
  • 10
1
2
3
17 18