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
0 answers

Angular UI Router escaped slashes bug when go to state manually

Why Angular UI router in my simple example encode slashes in url if I mannually trigger state change (with $state.go(toState, toParams)). $rootScope.$on("$stateChangeStart", function (event, toState, toParams, fromState, fromParams, error) { …
Vlatko
  • 1,385
  • 1
  • 18
  • 35
0
votes
1 answer

.htaccess - Remove trailing slash

Currently I have a htaccess in my wordpress site that adds a trailing slash to my urls. Somehow I can't figure out where it is in my htaccess. Can you tell which one does that in the following code? And how to remove trailing slash in the current…
Loreto Gabawa Jr.
  • 1,996
  • 5
  • 21
  • 33
0
votes
1 answer

Trailing slash redirect

Following a bug report in MAMP, initiated by another SO topic, I would like to ask how one would counter this bug where MAMP 3.0.6 (latest version) does not behave correctly with the following .htaccess rule : RewriteRule ^(.*)/$ /$1…
user3856210
  • 270
  • 2
  • 12
0
votes
1 answer

htaccess remove trailing slash

I have following htaccess: RewriteEngine On RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{REQUEST_FILENAME} !-d RewriteRule ^.*$ index.php [QSA,NC,L] and all is working fine. But now I need to remove trailing slash from url. Which means that …
0
votes
1 answer

Remove trailing slash wordpress website URLs

I have wordpress permalinks set up to /%postname% (note there is no trailing slash at the end). However, wordpress is not redirecting any given page URL from the version with the trailing slash to the non trailing slash version. Any website header…
0
votes
1 answer

How do I remove a trailing slash of subdomain URL in htaccess?

Currently, when a request is made for a URL that is not a directory, my .htaccess is set up to remove any trailing slash. The problem is, that is causing test.domain.com/order.php/ to be redirected to test.domain.com/test/order.php instead of…
CLL
  • 1,312
  • 3
  • 13
  • 26
0
votes
0 answers

Problems with mod_deflate on uri without trailing slash

I want to make mod_deflate working on my website. All works fine: for the css, js etc files, mod_deflate is working. When I go to host/city/, it also works fine. But when I call host/city it doesn't work. But I want to use the uri without trailing…
Nico
  • 39
  • 3
0
votes
1 answer

Adding a trailing slash on one condition in apache mod_rewrite

I know this is a common problem and I know there is a simple solution, however I cannot get the solutions that I have found online to work with my situation. I have an address as such: https://localhost/cms However, when a visitor goes to this…
James Little
  • 601
  • 7
  • 24
0
votes
1 answer

.htaccess - issue with folder once I get rid of the extensions

So I have managed to get rid of the php extensions through the .htaccess handler, but the problem occurs with one particular url which shares the name with a directory. Ie. the directory, which is in the root, is called "somename" and the page is…
Jipalo
  • 1
0
votes
1 answer

Browse zipfiles on apache webserver

I already have an awk script called viewzip.cgi which works as follows: ...viewzip.cgi/path_to_zipfile/zipfile.zip/ will show the root directory of that file, ...viewzip.cgi/path_to_zipfile/zipfile.zip/subdir/ shows a subdirectory (if…
0
votes
1 answer

Removing trailing slash by htaccess

Depending on google suggestions, I tried to add some codes to my .htaccess to prevent duplicate content. This is my code: #Duplicate Content RewriteCond %{HTTP_HOST} !^www.soomar63.com$ [NC] RewriteRule ^(.*)$ http://www.soomar63.com/$1…
Amir
  • 45
  • 4
0
votes
2 answers

Remove "/" from the end of a variable

Can any one please tell me how I can remove the slash from the end of a variable In my index.php I have the following: $url=$_SERVER['REQUEST_URI']; include_once "sites/$url.php"; My problem is if I write example.com/test/somefile/ nothing comes…
KaareZ
  • 615
  • 2
  • 10
  • 22
0
votes
2 answers

htaccess trailing slash redirect with Kirby

Is it possible to redirect a url without trailing slash to the URLs with trailing slash in Kirby CMS? How? From http://www.test.com/page To http://www.test.com/page/ htaccess file DirectorySlash On RewriteEngine…
Jens Törnell
  • 23,180
  • 45
  • 124
  • 206
0
votes
1 answer

htaccess remove trailing slash causes redirect loop

I am amending my htaccess file to achieve non-www to www (this is working) plus removing the trailing slash at the end of the URL, e.g.: www.domain.bc.ca/club/ ---> www.domain.bc.ca/club www.domain.bc.ca/club/index.html/ --->…
mandymoo
  • 1
  • 1
0
votes
2 answers

How to handle both /url and /url/ redirects with htaccess?

I am rewriting all URLs and shorthand some of them: RewriteEngine On RewriteBase / RewriteCond %{HTTP_HOST} ^www\.(([^\.]+))\.pl [NC] RewriteRule ^(.*)$ http://%1.pl%{REQUEST_URI} [R=301,L] RewriteRule ^test$ test-page.php [R=301,L] so…
Szymon Toda
  • 4,454
  • 11
  • 43
  • 62