Stack Exchange Network

Stack Exchange network consists of 175 Q&A communities including Stack Overflow, the largest, most trusted online community for developers to learn, share their knowledge, and build their careers.

Visit Stack Exchange

Questions tagged [trailing-slash]

The tag has no usage guidance.

0
votes
0answers
7 views

Should I enforce a trailing slash on my site? [duplicate]

Is there an advantage to doing so? I don’t know whether to force one on the end via htaccess or not. Thanks!
1
vote
0answers
42 views

Oracle HTTP server URL with no trailing slash causes redirect when HTTPS is used

My application is hosted in oracle weblogic 12c with OHS 12c and have SSL enabled at port 1234. URL as such HTTP : http://servername.example/webName HTTPS : https://servername.example:1234/webName ...
-1
votes
1answer
312 views

How to remove trailing slash from my root URL in htaccess?

I've tried several ways to remove the trailing slash from my URL in .htaccess and nothing worked but now even my URL can't be found because now it has a slash. Here is what my .htaccess looks like. I ...
3
votes
1answer
50 views

Should redirects to the home page including a trailing slash?

The website URL is http://example.com but some pages have been redirected to http://example.com/, the version of the URL with the trailing slash. Should I change all redirects to the non-trailing-...
1
vote
1answer
595 views

Forcing trailing slash at end of “fake” folders

The working codes that I've found here most put a slash in everything. I just need force trailing slash in these "fake dirs" (that are part of my rewriting scheme (only directories)) and keep ...
1
vote
0answers
53 views

Clicking on a link in Google Analytics shows me data for the link without the / at the end, which is incorrect

Whenever I click on a link in G Analytics, it automatically redirects to show me the stats for the link without the obligatory / at the end. Which means it shows me almost nothing, since I have ...
3
votes
3answers
531 views

Trailing slash dups

My short research on trailing slashes duplicate On page issues, covers only the dir & dir/ cases. But what about the /file.html & /file.html/. Are they acceptable both or one of them should ...
3
votes
2answers
1k views

Redirect URL with multiple trailing dots and trailing slashes using .htaccess

I need to fire 301 redirection from example.com... to example.com and example.com////// to example.com Here is my code: RewriteCond %{THE_REQUEST} \ /([^\?\ .]*)\.(?:\?|\ |$) RewriteRule ^ /%1 [L,R=...
4
votes
1answer
1k views

Trailing slash, google search console and sitemap

I force usage of trailing slash for all of my pages under https://example.com, however the main domain remains without it - from what I've read it's OK to do so, but I'm not sure how does Google '...
2
votes
1answer
1k views

How to remove trailing slashes from URL with .htaccess in localhost?

Here is my localhost folder structure: •www (wamphost folder) •example.com (folder) •index.php With the current the URL results: localhost/example.com/ The URL I would like is: ...
1
vote
1answer
293 views

Trailing slashes, duplicate content and spam?

so a website has the homepage URL with a trailing slash and without, both indexed by Google. e.g. domain.com and domain.com/ The site owner runs into the duplicate content issue. It is easier for ...
0
votes
2answers
147 views

301 or canonical for URLs with a '/'?

Is it better to use 301 redirects to URLs with a trailing / to a URL without a trailing / or is it better to canonicalise one version?
1
vote
1answer
88 views

How to remove a slash with .htaccess

I have a problem, when I'm on the homepage and want to go to a page, it says this: continenten/.html on this server How can I remove the / so it's continenten.html and not continenten/.html? This ...
7
votes
2answers
3k views

Why do some domains have a '/' at the end of the home page URL? [duplicate]

I am wondering why some websites have a / at the end of their URL, but others don't. For example: www.google.com/ but then www.khanacademy.org (No /)
1
vote
1answer
2k views

Using htaccess to internally and externally redirect a page at the same time [duplicate]

I've been trying to figure this out for two hours, and I give up. I want to externally redirect about.php to about/, and also have about/ internally redirect to about.php RewriteRule ^about/$ /test/...
10
votes
4answers
10k views

In terms of SEO, what is the difference between a URL with and without a trailing slash?

In terms of SEO, what's the difference between: http://example.com/some-stuff/ and http://example.com/some-stuff I could not find anything useful regarding this concept, can you explain this?
7
votes
1answer
5k views

.htaccess redirect url without trailing slashes

In my htaccess I have some rewrited urls like these: RewriteRule ^first-page$ /subdir/page.php?id_page=1 [QSA,L] RewriteRule ^second-page$ /subdir/page.php?id_page=2 [QSA,L] RewriteRule ^third-page$ /...
3
votes
2answers
4k views

Remove multiple trailing slashes in a single 301 in .htaccess?

There is a similar question here, but the solution does not work in Apache for our site. I'm trying to remove multiple trailing slashes from URLs on our site. I found some .htaccess code that seems ...
13
votes
1answer
3k views

Canonical URL for a home page and trailing slashes

My home page could be potentially linked as: http://example.com http://example.com/ http://example.com/?ref=1 http://example.com/index.html http://example.com/index.html?ref=2 (the same page is ...
7
votes
3answers
38k views

How to remove trailing slashes from URL with .htaccess?

The situation Across the entire domain, we'd like the URLs to hide file extensions and remove trailing slashes, independent of the domain name itself (as in, works on any domain). Sample of our ...
12
votes
4answers
1k views

What is the difference between a homepage link with or without a trailing slash?

What is the difference between these two URLs: http://example.com/ http://example.com Should we always add the final / or avoid it? Does it make a difference?
8
votes
3answers
534 views

Why treat these as URLs with different path capitalization and trailing slash as different?

These are all strictly different urls: http://www.example.com/page http://www.example.com/pAge http://www.example.com/page/ http://www.example.com/paGE/ I get that it conforms to the strict ISO ...
1
vote
3answers
327 views

Url's with same content , but different: trailing slash and .html

I have a website with the following url: http://www.site.com/folder/ But I also have the following url: http://www.site.com/folder.html Is this really bad for Google SEO ?
44
votes
4answers
26k views

Does it make a difference if your URL path ends in a trailing slash or not?

Does it make any difference to SEO ratings what-so-ever if your url has a trailing slash: http://www.example.com/some/slug/paths/ as opposed to one that does not: http://www.example.com/some/slug/...