Questions tagged [trailing-slash]
The trailing-slash tag has no usage guidance.
35
questions
1
vote
1
answer
34
views
Odd slash added at start of file folder in Apache rewrite
I'm working with an Apache rewrite statement that reads:
RewriteRule ^((?!%{HTTP_HOST}).*)$ ${US_ROOTF_WWW}/www.%{HTTP_HOST}%{REQUEST_URI} [L,E=PROJECT_PREPENDED:1]
The value of {US_ROOTF_WWW} is C:/...
0
votes
0
answers
46
views
Run .htaccess rule to remove trailing slash only if such a file exists
I have the following .htaccess rule but I would only like it to run it if a file exists without the removed trailing slash:
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)/$ /$1 [L,R=301]
I use ...
0
votes
1
answer
92
views
Google-selected canonical is my original site rather than my multilingual site
Google-selected canonical is my original site rather than my multilingual site!
I built a website www.example.com, then I made it a multilingual site, with an "en" at the end. (original ...
1
vote
2
answers
147
views
Do links to the home page need to be consistent about the trailing slash?
If some pages on my website link to example.com and others link to example.com/, should I make sure that all internal links point to one version, or it doesn't matter?
1
vote
1
answer
85
views
Is a subdomain home page URL with a trailing slash equivalent to without?
For pesky trailing slashes at the end of URLs, example.com and example.com/ are equivalent. What about subdomain homepages such as support.example.com and support.example.com/? Is it the same rule?
1
vote
1
answer
99
views
Worth moving WordPress to Apache hosting to fix trailing slash duplicate content on Pantheon under Nginx?
Context: As you might know, Wordpress' permalink structure enforces a trailing slash at the end of URLs (so /about becomes /about/ etc.)
I've always found this useful -- keeps URLs nice and uniform.
...
1
vote
1
answer
423
views
Remove PHP extension from URLs such that the URLs work with or without a trailing slash
My directory structure is
- Assets
- Dashboard
- index.php
- account.php
index.php
about.php
verify.php
What I basically want it to be:
Remove the .php extension for example http://example.org/...
0
votes
1
answer
264
views
Should I include a trailing slash for my <xhtml:link rel="alternate" href="URL" hreflang="en-US"/> URLs?
I'm implementing hreflang on my web app.
Google does not mention anything on https://support.google.com/webmasters/answer/189077?hl=en
But they use it (trailing slashes) on their own Sitemap.
https:...
1
vote
1
answer
126
views
Why would my site redirect back to the same page but with a trailing slash on the URL?
I'm working on a website that is new to me and I'm trying to make sure there is not practical reason why the site has been set up the way it is before I change it.
Many pages have been set up with ...
1
vote
1
answer
122
views
How to add trailing slashes to links in my pages from .htaccess in addition to the redirects I've implemented?
I've recently appended the trailing slash at the end of the URL by using this .htaccess code:
#add trailing slashes
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_URI} !(.*)/$
RewriteRule ^...
2
votes
0
answers
17
views
Does Google consider deep URLs with and without a trailing slash to be the same? [duplicate]
Will it hit my ranking if I have the same URLs where / on the end is the only difference?
Those URLs return the same content and one redirects to another or they both redirects to some 3rd URL.
...
1
vote
0
answers
18
views
Different counts of indexed pages for site: search on Google with trailing and without trailing slash
I am checking my website for the indexed pages using the site command.
I am getting the following results
site:in.example.com (about 23,000 results) [Without trailing slash]
site:in.example.com/ (...
1
vote
0
answers
447
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
1
answer
2k
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
1
answer
830
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
2
answers
1k
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
0
answers
135
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 ...
2
votes
3
answers
816
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 ...
4
votes
2
answers
3k
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=...
5
votes
1
answer
3k
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 '...
3
votes
1
answer
2k
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
1
answer
356
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
2
answers
408
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
1
answer
213
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 ...
9
votes
2
answers
8k
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
1
answer
3k
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
4
answers
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?
9
votes
2
answers
7k
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
2
answers
8k
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 ...
16
votes
1
answer
5k
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 ...
8
votes
3
answers
48k
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
4
answers
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
3
answers
708
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
3
answers
335
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 ?
54
votes
4
answers
31k
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/...