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 trying to use slashes without redirect 404 error

I am trying to prevent a 404 error and redirect when using mydomain.com/something It throws a 404 error because the page something.php does not exist. I want it to submit to the index page so I can capture the value with php and use it in my app. I…
dernex5
  • 1
  • 1
0
votes
0 answers

automatic trailing slash redirection with Spring MVC

I'd like to configure Spring MVC to do the following for me: If (a controller is not found && controller exist for requestURI with or without trailing slash) { redirect 301 to other URI with or without trailing slash } else { return 404…
Thomas Koch
  • 2,833
  • 2
  • 28
  • 36
0
votes
1 answer

IIS 7.5: Removing trailing slash doesn't work

We have ASP.NET application and set in web.config:
tesicg
  • 3,971
  • 16
  • 62
  • 121
0
votes
1 answer

Cyclic redirection in .htaccess

I have the following .htaccess file: AddDefaultCharset utf-8 RewriteEngine on Options +SymLinksIfOwnerMatch RewriteBase / # redirect all www-requests to no-www # - RewriteCond %{HTTP_HOST} ^www\.site\.com$ [NC] RewriteRule ^(.*)$ http://site.com/$1…
wh1t3cat1k
  • 3,146
  • 6
  • 32
  • 38
0
votes
1 answer

.htaccess URL redirected, clean url, trailing slash, force www

So I redirected one of my domains (which we'll call domain.com) into one of my subdirectories (which we'll call file) and I'm trying to achieve links that will cut down the index?page=, force the www, and have trailing slashes available for all…
Cee
  • 1
  • 4
0
votes
2 answers

New htaccess file - 301 re-directs and trailing slash

I am new here, I really need help I am creating a new site with opencart version 1.5.5.1 & I have tried creating my own htaccess file but it is not doing what I want it to do. I have tried a lot of the code from this site and my host sd, opencart is…
0
votes
2 answers

Remove trailing slash in WP multisite .htaccess file

I've created an .htaccess file that contains redirects for one site that is part of a larger WordPress Multisite install. The .htaccess content starts with this (necessary because the same .httacess file must be used for multiple sites: RewriteCond…
jonzal
  • 3
  • 1
0
votes
1 answer

.htaccess pretty URL's excluding index.php and adding trailing / to the end

Ok, I've fought with it for hours. I have 3 different .htaccess scripts which do what I need, but I'm unable to mix them together. Make a pretty url from (example.com/gallery.php -> example.com/gallery) Options +FollowSymLinks RewriteEngine…
yodalr
  • 9,778
  • 10
  • 32
  • 47
0
votes
1 answer

add trailing slash and remove .htaccess

How can I do something like this that: website.com/store/ redirect to website.com/store website.com/outbound/store/5 redirect to website.com/outbound/store/5/ what I want is to have for urls without prefix to remove trailing slash and for those with…
Marek
  • 440
  • 2
  • 6
  • 18
0
votes
1 answer

Removing html extentions and add trailing slash to files on all directories without affecting internal urls

I am using the code in below to redirect index.html and non-www version of URL to www. It also removes *.html extensions from the files. Now, I would like to add a trailing slash at the end of the files across all directories. Following are the…
0
votes
2 answers

Rewrite doesn't work without trailing slash

I have problems getting an URL to work WITHOUT entering trailing slash. It's: www.domain.com/shop/buy/products/show/range/ .htaccess Rewrite Rule is: RewriteRule ^shop/buy/([A-Za-z0-9]+)/show/([A-Za-z0-9\-\,]+)/?$ …
Noak
  • 13
  • 1
  • 4
0
votes
1 answer

URL missing trailing slash does not get redirected in CherryPy

I'm having a difficult time with CherryPy's handling of the static files. The problem has to do with the dealing of the URL's trailing slash. Sometimes the missing slash is added and sometimes it is not: the behavior is unpredictable. I'm convinced…
Bob Enohp
  • 1,302
  • 12
  • 11
0
votes
2 answers

htaccess mod_rewrite redirect directory paths with no trailing slash to PHP GET

I am building an ajax-driven website that uses html5 pushState() to preserve its url structure and facilitate reliable page reloads, etc. For this,I have set up my htaccess in such a way that any directory path that begins with an uppercase letter…
Erric
  • 750
  • 9
  • 29
0
votes
2 answers

.htaccess issue in wordpress

In my site the URL 1) http://www.example.com/pt-br/perguntas-frequentes/ - shows error 2) http://www.example.com/pt-br/perguntas-frequentes - working fine. I am using WPML plugin Code as follows RewriteEngine…
Raj
  • 406
  • 5
  • 12
0
votes
2 answers

Remove trailing slash from comment form

I need code to remove the trailing slash when a user enters their link. For example I need them to put their url to grab their avatar, but in some cases they put their url ending with a slash (.com/). How can I remove that slash automatically?…
Gio luna
  • 21
  • 6
1 2 3
17
18