Apache not adding trailing slash?mod_rewrite and trailing slashDjango running on Apache+WSGI and apache SSL...
I am on the US no-fly list. What can I do in order to be allowed on flights which go through US airspace?
If I delete my router's history can my ISP still provide it to my parents?
Are there any outlying considerations if I treat donning a shield as an object interaction during the first round of combat?
Could flying insects re-enter the Earth's atmosphere from space without burning up?
Do authors have to be politically correct in article-writing?
How do you funnel food off a cutting board?
Question about それに following a verb in dictionary form
Why avoid shared user accounts?
Do my Windows system binaries contain sensitive information?
How to avoid being sexist when trying to employ someone to function in a very sexist environment?
High pressure canisters of air as gun-less projectiles
Eww, those bytes are gross
Getting a UK passport renewed when you have dual nationality and a different name in your second country?
Avoiding morning and evening handshakes
How should I handle players who ignore the session zero agreement?
Longest Jewish year
Can I become debt free or should I file for bankruptcy? How do I manage my debt and finances?
Early credit roll before the end of the film
Inferring from (∃x)Fx to (∃x)(∃x)Fx using existential generalization?
If all harmonics are generated by plucking, how does a guitar string produce a pure frequency sound?
Slow moving projectiles from a hand-held weapon - how do they reach the target?
Why do neural networks need so many training examples to perform?
Does Windows 10's telemetry include sending *.doc files if Word crashed?
What do you call a fact that doesn't match the settings?
Apache not adding trailing slash?
mod_rewrite and trailing slashDjango running on Apache+WSGI and apache SSL proxyingApache2 - mod_expire and mod_rewrite not working in httpd.conf - serving content from tomcatNginx + Apache trailing slash redirectapache2 configuration for blog.example.com not workingApache trailing slash added to files problemApache proxypass trailing slash / directory issueTrailing Slash on Links pages not openingapache trailing slash redirect to httpsApache2 Redirect Trailing Slash Not Working
I've been reading that Apache should be adding trailing slashes to non-slashed directories. BUT mine is not doing so.
Here is my default-ssl
RewriteEngine On
RewriteCond %{HTTPS} off
RewriteRule ^ https://%{HTTP_HOST}%{REQUEST_URI}
<IfModule mod_ssl.c>
ExpiresActive On
ExpiresDefault "access plus 1 month"
Protocols h2 h2c http/1.1
ErrorDocument 400 https://example.co
ErrorDocument 403 https://example.co
ErrorDocument 404 https://example.co
ErrorDocument 405 https://example.co
ErrorDocument 408 https://example.co
ErrorDocument 500 https://example.co
ErrorDocument 502 https://example.co
ErrorDocument 504 https://example.co
<Directory /var/www/html/>
DirectorySlash On
SetHandler some-handler
Options FollowSymLinks MultiViews
AllowOverride All
Order allow,deny
allow from all
</Directory>
<FilesMatch ".(cgi|shtml|phtml|php)$">
SSLOptions +StdEnvVars
</FilesMatch>
<Directory /usr/lib/cgi-bin>
SSLOptions +StdEnvVars
</Directory>
Alias "/library/" "/var/www/html/example/library/"
<VirtualHost _default_:443>
ServerName example.co
DocumentRoot /var/www/html/example
SSLEngine on
SSLCertificateFile /etc/letsencrypt/live/example.co/cert.pem
SSLCertificateKeyFile /etc/letsencrypt/live/example.co/privkey.pem
SSLCertificateChainFile /etc/letsencrypt/live/example.co/chain.pem
</VirtualHost>
</IfModule>
I added:
DirectorySlash On
SetHandler some-handler
But nothing happens.
Is it default for Apache to add slashes? I've been using http://httpd.apache.org/docs/2.2/mod/mod_dir.html but I am having trouble since my slashes are not being generated. My test example.co/test/ works while example.co/test redirects to example.co.
Please let me know if any part of my configuration is wrong. Thanks!
update
What I've noticed is that if I delete:
ErrorDocument 400 https://example.co
ErrorDocument 403 https://example.co
ErrorDocument 404 https://example.co
ErrorDocument 405 https://example.co
ErrorDocument 408 https://example.co
ErrorDocument 500 https://example.co
ErrorDocument 502 https://example.co
ErrorDocument 504 https://example.co
The slashes are added but an error is thrown since the site is redirected to a unsecure HTTP instead of HTTPS.

Update 2
I added this under the ReWriteEngine On
RewriteCond %{HTTP:X-Forwarded-Proto} =https
RewriteCond %{LA-U:REQUEST_FILENAME} -d
RewriteRule ^/(.*[^/])$ https://%{HTTP_HOST}/$1/ [R=301,L,QSA]
As discussed in other similar issues without success.
apache-2.2 configuration
add a comment |
I've been reading that Apache should be adding trailing slashes to non-slashed directories. BUT mine is not doing so.
Here is my default-ssl
RewriteEngine On
RewriteCond %{HTTPS} off
RewriteRule ^ https://%{HTTP_HOST}%{REQUEST_URI}
<IfModule mod_ssl.c>
ExpiresActive On
ExpiresDefault "access plus 1 month"
Protocols h2 h2c http/1.1
ErrorDocument 400 https://example.co
ErrorDocument 403 https://example.co
ErrorDocument 404 https://example.co
ErrorDocument 405 https://example.co
ErrorDocument 408 https://example.co
ErrorDocument 500 https://example.co
ErrorDocument 502 https://example.co
ErrorDocument 504 https://example.co
<Directory /var/www/html/>
DirectorySlash On
SetHandler some-handler
Options FollowSymLinks MultiViews
AllowOverride All
Order allow,deny
allow from all
</Directory>
<FilesMatch ".(cgi|shtml|phtml|php)$">
SSLOptions +StdEnvVars
</FilesMatch>
<Directory /usr/lib/cgi-bin>
SSLOptions +StdEnvVars
</Directory>
Alias "/library/" "/var/www/html/example/library/"
<VirtualHost _default_:443>
ServerName example.co
DocumentRoot /var/www/html/example
SSLEngine on
SSLCertificateFile /etc/letsencrypt/live/example.co/cert.pem
SSLCertificateKeyFile /etc/letsencrypt/live/example.co/privkey.pem
SSLCertificateChainFile /etc/letsencrypt/live/example.co/chain.pem
</VirtualHost>
</IfModule>
I added:
DirectorySlash On
SetHandler some-handler
But nothing happens.
Is it default for Apache to add slashes? I've been using http://httpd.apache.org/docs/2.2/mod/mod_dir.html but I am having trouble since my slashes are not being generated. My test example.co/test/ works while example.co/test redirects to example.co.
Please let me know if any part of my configuration is wrong. Thanks!
update
What I've noticed is that if I delete:
ErrorDocument 400 https://example.co
ErrorDocument 403 https://example.co
ErrorDocument 404 https://example.co
ErrorDocument 405 https://example.co
ErrorDocument 408 https://example.co
ErrorDocument 500 https://example.co
ErrorDocument 502 https://example.co
ErrorDocument 504 https://example.co
The slashes are added but an error is thrown since the site is redirected to a unsecure HTTP instead of HTTPS.

Update 2
I added this under the ReWriteEngine On
RewriteCond %{HTTP:X-Forwarded-Proto} =https
RewriteCond %{LA-U:REQUEST_FILENAME} -d
RewriteRule ^/(.*[^/])$ https://%{HTTP_HOST}/$1/ [R=301,L,QSA]
As discussed in other similar issues without success.
apache-2.2 configuration
add a comment |
I've been reading that Apache should be adding trailing slashes to non-slashed directories. BUT mine is not doing so.
Here is my default-ssl
RewriteEngine On
RewriteCond %{HTTPS} off
RewriteRule ^ https://%{HTTP_HOST}%{REQUEST_URI}
<IfModule mod_ssl.c>
ExpiresActive On
ExpiresDefault "access plus 1 month"
Protocols h2 h2c http/1.1
ErrorDocument 400 https://example.co
ErrorDocument 403 https://example.co
ErrorDocument 404 https://example.co
ErrorDocument 405 https://example.co
ErrorDocument 408 https://example.co
ErrorDocument 500 https://example.co
ErrorDocument 502 https://example.co
ErrorDocument 504 https://example.co
<Directory /var/www/html/>
DirectorySlash On
SetHandler some-handler
Options FollowSymLinks MultiViews
AllowOverride All
Order allow,deny
allow from all
</Directory>
<FilesMatch ".(cgi|shtml|phtml|php)$">
SSLOptions +StdEnvVars
</FilesMatch>
<Directory /usr/lib/cgi-bin>
SSLOptions +StdEnvVars
</Directory>
Alias "/library/" "/var/www/html/example/library/"
<VirtualHost _default_:443>
ServerName example.co
DocumentRoot /var/www/html/example
SSLEngine on
SSLCertificateFile /etc/letsencrypt/live/example.co/cert.pem
SSLCertificateKeyFile /etc/letsencrypt/live/example.co/privkey.pem
SSLCertificateChainFile /etc/letsencrypt/live/example.co/chain.pem
</VirtualHost>
</IfModule>
I added:
DirectorySlash On
SetHandler some-handler
But nothing happens.
Is it default for Apache to add slashes? I've been using http://httpd.apache.org/docs/2.2/mod/mod_dir.html but I am having trouble since my slashes are not being generated. My test example.co/test/ works while example.co/test redirects to example.co.
Please let me know if any part of my configuration is wrong. Thanks!
update
What I've noticed is that if I delete:
ErrorDocument 400 https://example.co
ErrorDocument 403 https://example.co
ErrorDocument 404 https://example.co
ErrorDocument 405 https://example.co
ErrorDocument 408 https://example.co
ErrorDocument 500 https://example.co
ErrorDocument 502 https://example.co
ErrorDocument 504 https://example.co
The slashes are added but an error is thrown since the site is redirected to a unsecure HTTP instead of HTTPS.

Update 2
I added this under the ReWriteEngine On
RewriteCond %{HTTP:X-Forwarded-Proto} =https
RewriteCond %{LA-U:REQUEST_FILENAME} -d
RewriteRule ^/(.*[^/])$ https://%{HTTP_HOST}/$1/ [R=301,L,QSA]
As discussed in other similar issues without success.
apache-2.2 configuration
I've been reading that Apache should be adding trailing slashes to non-slashed directories. BUT mine is not doing so.
Here is my default-ssl
RewriteEngine On
RewriteCond %{HTTPS} off
RewriteRule ^ https://%{HTTP_HOST}%{REQUEST_URI}
<IfModule mod_ssl.c>
ExpiresActive On
ExpiresDefault "access plus 1 month"
Protocols h2 h2c http/1.1
ErrorDocument 400 https://example.co
ErrorDocument 403 https://example.co
ErrorDocument 404 https://example.co
ErrorDocument 405 https://example.co
ErrorDocument 408 https://example.co
ErrorDocument 500 https://example.co
ErrorDocument 502 https://example.co
ErrorDocument 504 https://example.co
<Directory /var/www/html/>
DirectorySlash On
SetHandler some-handler
Options FollowSymLinks MultiViews
AllowOverride All
Order allow,deny
allow from all
</Directory>
<FilesMatch ".(cgi|shtml|phtml|php)$">
SSLOptions +StdEnvVars
</FilesMatch>
<Directory /usr/lib/cgi-bin>
SSLOptions +StdEnvVars
</Directory>
Alias "/library/" "/var/www/html/example/library/"
<VirtualHost _default_:443>
ServerName example.co
DocumentRoot /var/www/html/example
SSLEngine on
SSLCertificateFile /etc/letsencrypt/live/example.co/cert.pem
SSLCertificateKeyFile /etc/letsencrypt/live/example.co/privkey.pem
SSLCertificateChainFile /etc/letsencrypt/live/example.co/chain.pem
</VirtualHost>
</IfModule>
I added:
DirectorySlash On
SetHandler some-handler
But nothing happens.
Is it default for Apache to add slashes? I've been using http://httpd.apache.org/docs/2.2/mod/mod_dir.html but I am having trouble since my slashes are not being generated. My test example.co/test/ works while example.co/test redirects to example.co.
Please let me know if any part of my configuration is wrong. Thanks!
update
What I've noticed is that if I delete:
ErrorDocument 400 https://example.co
ErrorDocument 403 https://example.co
ErrorDocument 404 https://example.co
ErrorDocument 405 https://example.co
ErrorDocument 408 https://example.co
ErrorDocument 500 https://example.co
ErrorDocument 502 https://example.co
ErrorDocument 504 https://example.co
The slashes are added but an error is thrown since the site is redirected to a unsecure HTTP instead of HTTPS.

Update 2
I added this under the ReWriteEngine On
RewriteCond %{HTTP:X-Forwarded-Proto} =https
RewriteCond %{LA-U:REQUEST_FILENAME} -d
RewriteRule ^/(.*[^/])$ https://%{HTTP_HOST}/$1/ [R=301,L,QSA]
As discussed in other similar issues without success.
apache-2.2 configuration
apache-2.2 configuration
edited 4 hours ago
Matthew Semik
asked 5 hours ago
Matthew SemikMatthew Semik
1114
1114
add a comment |
add a comment |
0
active
oldest
votes
Your Answer
StackExchange.ready(function() {
var channelOptions = {
tags: "".split(" "),
id: "2"
};
initTagRenderer("".split(" "), "".split(" "), channelOptions);
StackExchange.using("externalEditor", function() {
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled) {
StackExchange.using("snippets", function() {
createEditor();
});
}
else {
createEditor();
}
});
function createEditor() {
StackExchange.prepareEditor({
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: true,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: 10,
bindNavPrevention: true,
postfix: "",
imageUploader: {
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
},
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
});
}
});
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fserverfault.com%2fquestions%2f956494%2fapache-not-adding-trailing-slash%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
0
active
oldest
votes
0
active
oldest
votes
active
oldest
votes
active
oldest
votes
Thanks for contributing an answer to Server Fault!
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fserverfault.com%2fquestions%2f956494%2fapache-not-adding-trailing-slash%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown