Questions tagged [trailing-slash]

A slash sign at the end of a URL.

A slash sign at the end of a URL.

263 questions
3
votes
3 answers

How to parse paths in text without trailing slash using regex?

I have a log that includes a lot of paths along with other text. I want to get specific paths from the log without a trailing slash. How to do it using regex? For example, the text is: some text /dir1/dir2/ some text some text /dir1/dir3 some…
tkmamedov
  • 31
  • 1
3
votes
1 answer

Htaccess – remove html extension + add trailing slash + find index inside subfolder (combined)

I've been struggling with this question for a week now. My website root is something like this: index.html page.html subfolder/index.html subfolder/page.html I've read tons of posts to do these 3 things. I can actually do them separately but I…
3
votes
1 answer

Django routing with VueJS single page has unexpected behaviour when there is no trailing slash in the URL

I have a Django backend, VueJS frontend combination, where I serve a REST API via Django and a single page application with VueJS and vue-router. From this question I got the tip to use the following urls in my main urls.py: urlpatterns = [ …
Truning
  • 107
  • 1
  • 10
3
votes
0 answers

How to keep trailing slash in URL in angular 2 or > in Child Routes?

I want to know how to force the use of final slash in Angular routing. I am using this methodology to maintain the final slash in Angular App, I used this documentation a link! export const contactUsRoutes: Routes = [ { path:…
juanjinario
  • 596
  • 1
  • 9
  • 24
3
votes
1 answer

Why Doesn't Dividing a path by the Default Constructed path Just add a Trailing Separator in Visual Studio?

Let's say that filesystem::current_path will return the path: /tmp/1567519419.773012 But I want a trailing separator. If seems like all I should have to do would be: filesystem::current_path() / filesystem::path() This works on gcc giving…
Jonathan Mee
  • 37,899
  • 23
  • 129
  • 288
3
votes
0 answers

Remove trailing slash from directory containing WordPress

I have a website with a separate blog in a /wordpress/ directory. Currently the blog is available at https://website.com/wordpress/ The blog items do not have a trailing slash and are available at https://website.com/wordpress/newsitem-name I would…
Ruud Kok
  • 101
  • 9
3
votes
1 answer

how to remove trailing slash on post request nginx

I'm trying to remove trailing slash on http post method, when i try to re-write the URL using rewrite ^/(.*)/$ /$1 permanent; it doesn't work for me The upstream should receive in this format /x/y if the Http POST is coming in these…
anish
  • 6,884
  • 13
  • 74
  • 140
3
votes
2 answers

Retrofit trailing slash on relative urls

Does Retrofit remove the trailing slash from a relative url for an endpoint? I have tried adding the trailing slash on one of my endpoints but when i step through with a debugger and i look at the Call object, if I drill into the delete.relativeUrl…
Etienne Lawlor
  • 6,817
  • 18
  • 77
  • 89
3
votes
1 answer

Redirect URLs without trailing slash to URL with trailing slash

I want to have only URLs with trailing slash on my website. At the moment I have only URLs without trailing slash. How I have to modify my htaccess? Here it is: RewriteEngine On RewriteBase / RewriteCond %{REQUEST_FILENAME}…
tom84
  • 371
  • 1
  • 3
  • 15
3
votes
1 answer

htaccess trailing slash issue

I am getting some problem for without trailing slash url. I searched in Google, but not able to get the exact result. From Url : local.xxxx.com/stories When I am trying with the above Url, It redirects to To Url :…
robert
  • 43
  • 7
3
votes
2 answers

removing multiple groups of slashes everywhere in URL in .htaccess

I currently have a website where guests are able to access each url with any number of slashes to separate folder names. For example, if a URL is supposed to be: http://example.com/one/two/three/four Then users could access the same page via any of…
Mike -- No longer here
  • 2,064
  • 1
  • 15
  • 37
3
votes
0 answers

Front page of WordPress in a subdirectory automatically redirecting and adding a trailing slash to front page URL?

I'm working with a WordPress installation in a subdirectory. I'd like the front page URL to not have a trailing slash. I've already set the permalinks to not have any trailing slashes in the WordPress admin screen. However since this WordPress…
2
votes
1 answer

In Struts2 HOWTO handle a url with same namespace but with or without the trailing slash similarly

In struts2 I am writing an app where I need to make sure that the url redirection works the same whether or not there is a trailing slash at the end. E.g. example.com/app should behave same way as if user entered example.com/app/. Currently I…
Chantz
  • 5,883
  • 10
  • 56
  • 79
2
votes
2 answers

Add trailing slash at dynamic .htaccess

I have a site with a big .htaccess with a lot of dynamic rules, everything works fine, but unfortunately, Google is duplicating my URLs, considering the same URL with trailing slash and without... I will paste the code of my .htaccess if someone…
Sophie
  • 410
  • 3
  • 10
2
votes
1 answer

.htaccess changes URL when trailing slash is omitted

I have a multiple sites in one root domain with .htaccess. There is my RewriteEngine On RewriteCond %{HTTP_HOST} ^192\.168\.0\.6$ RewriteCond %{REQUEST_URI} !/192.168.0.6/ RewriteRule ^(.*)$ /192.168.0.6/$1 [L] RewriteCond %{HTTP_HOST}…
1 2
3
17 18