Questions tagged [trailing-slash]

A slash sign at the end of a URL.

A slash sign at the end of a URL.

263 questions
1
vote
1 answer

Bolt trailing slash

im using bolt for a little time now and have never done anything with htacces files before. my question in this tread is, how do i put a trailing slash in a url generated by bolt. i was trying stuff out and looking things up on how to do this. but i…
B. Dionys
  • 916
  • 7
  • 34
1
vote
0 answers

Add trailing slash before ProxyPass to other domain

I've got this set up on my apache configuration file: ProxyPassMatch ^/webdocs/(.*)$ http://other-domain/webdocs/$1 retry=0 ProxyPassReverse ^/webdocs/(.*)$ http://other-domain/webdocs/$1 retry=0 So when users access to the subdirectory webdocs in…
rmartrenado
  • 1,516
  • 1
  • 18
  • 42
1
vote
1 answer

Unable to enforce trailing slash through .htaccess

I have the following content in my .htaccess file place in the root directory: RewriteEngine On RewriteBase / RewriteCond %{REQUEST_FILENAME} !-f RewriteRule ^([^\.]+)$ $1.html [NC,L] RewriteCond %{REQUEST_FILENAME} !-f RewriteRule ^(.*[^/])$ /$1/…
Mihir Chaturvedi
  • 266
  • 1
  • 5
  • 12
1
vote
1 answer

Remove Double trailing slash - open cart

i have been contiously upgrading my htaccess file. however, there are 2 issues I just cant seem to fix. I have tried several approaches but nothing really worked for me. my website: https://www.zeroohm.com/ my questions: How can I remove the extra…
m.saeed
  • 33
  • 4
1
vote
2 answers

How to enforce trailing slash on everything EXCEPT filenames with htaccess

I would like to enforce a trailing slash on all URLS except on filenames. Here is my .htaccess file so far. RewriteEngine On RewriteCond %{HTTP_HOST} ^(www\.)(.+) [OR] RewriteCond %{HTTPS} off RewriteCond %{HTTP_HOST} ^(www\.)?(.+) RewriteRule ^…
user3424298
1
vote
1 answer

Trail slash is causing 404 error and improper url behavior: APACHE/ PHP

Hoping one of you can help. I am developing using php, without a framework, therefore all of my routing rules are in .htaccess as opposed to .php So here is my problem. Say my website is http://example.com and my navigation is pretty straight…
1
vote
2 answers

Angular Route with multiple slashes override folder path

I have an Angular app using ngRoute module along with HTML5 mode pushState for cleaner URL. app.config(function($routeProvider, $locationProvider){ $locationProvider.html5Mode(true); $routeProvider //Route for home page .when("/", { …
1
vote
2 answers

Redirect .html and trailing slash

I'm having a little trouble with my site's .htaccess file. I want to have both the page.html and page/ URLs redirect to page without any suffix. I've been able to get the .html off, but when entering the page/ URL I get an internal server error no…
L. Thane
  • 83
  • 9
1
vote
1 answer

Handle trailing slash with Codeigniter 3

I have a database of articles with the urls as follow: person/albert-einstein/ (trailing slash) person/albert-einstein/1 (no trailing slash) And I was wondering what was the best way to handle url trailing slashes in Codeigniter 3? This is what I…
gglasses
  • 826
  • 11
  • 30
1
vote
1 answer

Use .htaccess to redirect with any appended text transferred to new redirect

I'm a little stuck. I have the following redirect in .htaccess Redirect http://www.domain1.com http://www.domain2.com/subdomain= Although I want that if someone types www.domain1.com/12345, it will automatically append the 12345 to the redirect URL…
Obie
  • 13
  • 2
1
vote
1 answer

Trailing Slash 301 Redirect Issue When ? Is In URL

htaccess | 301 redirect | URI Issue I recently applied this code to my htaccess to enforce the trailing slash on my URL: #Trailing backslash RewriteBase / RewriteCond %{HTTP_HOST} !^www\. [NC] RewriteRule ^(.*)$ https://www.example.com/$1…
Trent
  • 429
  • 1
  • 5
  • 19
1
vote
0 answers

How to redirect .php extension and add a trailing slash to all urls in nginx

The nginx.conf below is working, except to the home page that localdomain, redirects to localdomain/index/. This confing redirects .php to / trailing slash , and phpless url to trailing slash as well. Obviously though , something is wrong, and all…
Skeptic
  • 1,254
  • 14
  • 18
1
vote
1 answer

How can I get rid of trailing slash for index.html

How do I get rid of the trailing slash on my site? For example, I have an index.html at http://example.com/examplepage/index.html Instead of http://example.com/examplepage/ I would like the URL to be http://example.com/examplepage Could…
Zooza S
  • 307
  • 1
  • 4
  • 17
1
vote
1 answer

Add trailing slash to url only if parameter is correct

I use the configuration below in .htaccess file to force trailing slash at the end of the url. But this setting is not good when an url is wrong (city parameter is not present in the database) because it redirect /wrongcity to /wrongcity/ instead to…
Davide
  • 1,635
  • 1
  • 16
  • 29
1
vote
1 answer

htaccess: php language variable on index page

I'm trying to clean up urls from extensions and php get language variables: test.com/en/ => test.com/?lang=en test.com/ro/page/ => test.com/page.php?lang=ro Here is my .htaccess: AddDefaultCharset utf-8 Options +FollowSymlinks…
vlad
  • 1,511
  • 5
  • 17
  • 26