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
1 answer

htaccess: Remove trailing slash from URL ending with .xml/ only

I need to remove trailing slash from URLs ending with .xml/ only .. For this purpose I've created a Rewrite Condition and Rule which is working perfectly fine for the test link http://website.com/test.xml/ Test Link:…
Hassan Alvi
  • 133
  • 1
  • 8
0
votes
1 answer

Redirect all pages with trailing to the URL without trailing WHEN part of the root is a folder

I have tried all codes found to redirect my pages when typing them with trailing to the root URL, BUT it works only for URL which are not folders, i.e. for a link /mylink.html I have the folder "mylink" and inside it I put my articles, so I try to…
0
votes
1 answer

Google Analytics - grouping Page

I've been reading a lot about grouping page on Google Analytics but haven't figured out a clear answer to a problem. My issue is this one : Same pages but one with / and other without / Basically, when I read my analytics I have two different entry…
Amor Armand
  • 97
  • 1
  • 6
0
votes
1 answer

Add slash to redirect if URL is not ending with slash in Nginx

I wanted to add a slash to a redirect URL because the target (Wordpress) also redirects if the url does not end with a slash. This would result in two redirects. My current config doesn't seem to work server { listen 80; server_name…
KingOfCoders
  • 2,253
  • 2
  • 23
  • 34
0
votes
1 answer

301 Redirect not working from Google results link

My htaccess 301 redirects work if I type the url without a trailing slash like... www.nicksplumbing.com/water-heater If I use a trailing slash like... www.nicksplumbing.com/water-heater/ The redirect adds a trailing slash after the new pages url…
Rhino
  • 39
  • 8
0
votes
0 answers

redirect all URLS to no trailing slash php

My folder structure is, I used htaccess for NO trailing slash at the end of each URL -job.php to /job -companies.php to /companies -about.php to /about -Admin_jobs(This is Admin Folder) and My .htaccess file is Options +FollowSymLinks…
Ganga
  • 31
  • 4
0
votes
3 answers

Add a trailing slash while building URLs from Helpers in CakePHP 3

I'm working on a blog-like website in CakePHP 3 and made the canonical URL structure with a trailing slash for SEO purposes. To accomplish this, in the routes file I built the requests to match a trailing slash, and in the webroot .htaccess made the…
0
votes
1 answer

Remove Trailing slash from Wordpress slug

I want to retrieve the slug of the current page in Wordpress. This works: post_name;?> But it contains a trailing slash. I want to trim the traling slash, how can I do that? Thanks?
Xander
  • 1
  • 3
0
votes
1 answer

Allowing a trailing slash for a specific dynamic url?

I have done a 301 redirect for all trailing splash URLs in my htaccess file. Now I have a few dynamic URLs `website.com/item/activate/#dynamiclychangingvalue**/** that need the splash. Note that in the end on the activate folder is a dynamic url…
mark669
  • 21
  • 3
0
votes
1 answer

MOD_REWRITE - URL ENDING TRAILING SLASH

Options -Indexes +FollowSymLinks -MultiViews RewriteEngine On RewriteCond %{HTTP_HOST} ^(.*)$ [NC] RewriteCond %{HTTP_HOST} !^(.*)\.(.*)\. [NC] RewriteCond %{HTTPS}s ^on(s)| RewriteRule ^ HTTP%1://www.%{HTTP_HOST}%{REQUEST_URI}…
Paolo Sanna
  • 73
  • 1
  • 5
0
votes
1 answer

Apache's mod_rewrite failing to remove trailing slash

I have a XAMPP Apache server, and have added a configuration file to rewrite URLs with a trailing slash and redirect to their slash-less counterparts. Therefore, a url like http://example.com/the-audio/ gets redirected to…
undefined
  • 3,949
  • 4
  • 26
  • 38
0
votes
2 answers

URL trailing slash gets removed

I recently found a bug that when i go to example.com/phpmyadmin or example.com/index the trailing slash gets removed, so it's calling example.comphpadmin or example.comindex. This happens with everything after the slash. But if i have a second…
HypnoTox
  • 11
  • 4
0
votes
1 answer

Remove Trailing Slash From URLs

I'm trying to remove the trailing slash from our URLs. I adjusted our .htaccess file and added this code: RewriteCond %{REQUEST_FILENAME} !-d RewriteRule ^(.*)/$ /$1 [L,R=301] Unfortunately this didn't work as the pages (except for the homepage)…
0
votes
1 answer

Redirect if using trailing slash in URL. htaccess

How can I make it so when a user uses a trailing slash, for example this link: website.com/staff/ It will redirect to a 404 not found page?
bbcode
  • 37
  • 6
0
votes
1 answer

Add trailing slash to subfolder URL

I am using ASP MVC as my lanugage and I have a website with multiple subfolders/applications in it. www.sample.com www.sample.com/zh www.sample.com/en What I need is to add a trailing slash to the end of the URL…
simplecoder
  • 203
  • 2
  • 9