mersenneforum.org  

Go Back   mersenneforum.org > Other Stuff > Forum Feedback

Reply
 
Thread Tools
Old 2015-05-06, 20:58   #1
Mark Rose
 
Mark Rose's Avatar
 
"/X\(‘-‘)/X\"
Jan 2013

3·977 Posts
Default ftp.mersenneforum.org

I notice that the forum is available at http://ftp.mersenneforum.org and that Google indexes that. It might be an idea to disable the forum from being accessible on ftp.mersenneforum.org or to set a canonical URL to point to the www version so Google returns results only on www.
Mark Rose is offline   Reply With Quote
Old 2015-05-07, 01:46   #2
TObject
 
TObject's Avatar
 
Feb 2012

34×5 Posts
Default

Add the following to the Apache host configuration (somewhere within VirtualHost tag, for example):

Code:
RewriteEngine on
RewriteCond %{HTTP_HOST} !^www\.mersenneforum\.org$ [NC]
RewriteCond %{SERVER_PORT}s ^(443(s)|[0-9]+s)$
RewriteRule ^(.*)$ http%2://www.mersenneforum.org%{REQUEST_URI} [R=301,L]
TObject is offline   Reply With Quote
Old 2015-05-07, 02:44   #3
Xyzzy
 
Xyzzy's Avatar
 
"Mike"
Aug 2002

3×2,689 Posts
Default

Quote:
Originally Posted by TObject View Post
Add the following to the Apache host configuration (somewhere within VirtualHost tag, for example):

Code:
RewriteEngine on
RewriteCond %{HTTP_HOST} !^www\.mersenneforum\.org$ [NC]
RewriteCond %{SERVER_PORT}s ^(443(s)|[0-9]+s)$
RewriteRule ^(.*)$ http%2://www.mersenneforum.org%{REQUEST_URI} [R=301,L]
Will this work in a directory-specific .htaccess file? We do not have access to the "big boy" file.

(Also, what does it do?)

Xyzzy is offline   Reply With Quote
Old 2015-05-07, 03:04   #4
TObject
 
TObject's Avatar
 
Feb 2012

40510 Posts
Default

If the AllowOverride FileInfo configuration option is set, then this should work from .htaccess file.

Apache mod_rewrite module is required (usually it is on).

What does this do? It permanently redirects everything that does not look like www.mersenneforum.org to www.mersenneforum.org, and keeps the correct protocol (http/https) and correct request string after the domain name.

For example, when somebody or a robot goes to
Code:
http://ftp.mersenneforum.org/showthread.php?p=401885#post401885
They/it will be automatically redirected to
Code:
http://www.mersenneforum.org/showthread.php?p=401885#post401885
TObject is offline   Reply With Quote
Old 2015-05-07, 04:05   #5
Xyzzy
 
Xyzzy's Avatar
 
"Mike"
Aug 2002

11111100000112 Posts
Default

We applied your change and it looks like it worked. Thanks!

Xyzzy is offline   Reply With Quote
Old 2015-05-07, 18:22   #6
TObject
 
TObject's Avatar
 
Feb 2012

34·5 Posts
Thumbs up

You are welcome.

As Google spider re-visits the offending pages it will make a note of the correct destinations and the search index should get updated accordingly. This usually takes a while…
TObject is offline   Reply With Quote
Old 2015-05-13, 17:40   #7
Xyzzy
 
Xyzzy's Avatar
 
"Mike"
Aug 2002

806710 Posts
Default

Somehow the new rewrite rules are not working for links like this:

http://mersenneforum.org/gimps/mprime276-linux64.tar.gz

Instead it shows the "banned" message.



Code:
ErrorDocument 403 "Your IP address has been banned. If you think this is a mistake, please email xyzzyATmersenneforumDOTorg for assistance."
Options -Indexes
<ifModule mod_deflate.c>
  AddOutputFilterByType DEFLATE text/html text/xml text/css text/plain
  AddOutputFilterByType DEFLATE image/svg+xml application/xhtml+xml application/xml
  AddOutputFilterByType DEFLATE application/rdf+xml application/rss+xml application/atom+xml
  AddOutputFilterByType DEFLATE text/javascript application/javascript application/x-javascript application/json
  AddOutputFilterByType DEFLATE application/x-font-ttf application/x-font-otf
  AddOutputFilterByType DEFLATE font/truetype font/opentype
</ifModule>
<ifModule mod_expires.c>
  ExpiresActive On
  ExpiresDefault "access plus 5 seconds"
  ExpiresByType image/x-icon "access plus 604800 seconds"
  ExpiresByType image/jpeg "access plus 604800 seconds"
  ExpiresByType image/png "access plus 604800 seconds"
  ExpiresByType image/gif "access plus 604800 seconds"
  ExpiresByType text/css "access plus 604800 seconds"
  ExpiresByType text/javascript "access plus 604800 seconds"
  ExpiresByType application/javascript "access plus 604800 seconds"
  ExpiresByType application/x-javascript "access plus 604800 seconds"
 </ifModule>
RewriteEngine on
RewriteCond %{HTTP_HOST} !^www\.mersenneforum\.org$ [NC]
RewriteCond %{SERVER_PORT}s ^(443(s)|[0-9]+s)$
RewriteRule ^(.*)$ http%2://www.mersenneforum.org%{REQUEST_URI} [R=301,L]
order allow,deny
    Lots of IP addresses!
allow from all
Xyzzy is offline   Reply With Quote
Old 2015-05-13, 18:38   #8
Mark Rose
 
Mark Rose's Avatar
 
"/X\(‘-‘)/X\"
Jan 2013

3×977 Posts
Default

Try changing

RewriteCond %{HTTP_HOST} !^www\.mersenneforum\.org$ [NC]

to

RewriteCond %{HTTP_HOST} ^ftp\.mersenneforum\.org$ [NC]

that will only rewrite links to ftp.mersenneforum.org, not anything that isn't www.mersenneforum.org.
Mark Rose is offline   Reply With Quote
Old 2015-05-13, 20:34   #9
TObject
 
TObject's Avatar
 
Feb 2012

34×5 Posts
Default

Not sure what is going on here... Check a couple of things, please:
* The /gimps folder does not have an .htaccess file of its own, right?
* Is there any evidence in the web server log files (errors are often in a separate log file), maybe file locations looking wrong or folders missing in the file paths?
TObject is offline   Reply With Quote
Old 2015-05-14, 01:16   #10
Xyzzy
 
Xyzzy's Avatar
 
"Mike"
Aug 2002

3·2,689 Posts
Default

Quote:
Originally Posted by Mark Rose View Post
Try changing

RewriteCond %{HTTP_HOST} !^www\.mersenneforum\.org$ [NC]

to

RewriteCond %{HTTP_HOST} ^ftp\.mersenneforum\.org$ [NC]

that will only rewrite links to ftp.mersenneforum.org, not anything that isn't www.mersenneforum.org.
We tried the change and it did not fix anything. For now we have commented out the entire section.
Xyzzy is offline   Reply With Quote
Old 2015-05-14, 01:20   #11
Xyzzy
 
Xyzzy's Avatar
 
"Mike"
Aug 2002

3·2,689 Posts
Default

Quote:
Originally Posted by TObject View Post
* The /gimps folder does not have an .htaccess file of its own, right?
Yes, it has one:

Code:
Options Indexes
IndexIgnore HEADER.html
IndexOptions IgnoreCase FancyIndexing FoldersFirst NameWidth=* SuppressHTMLPreamble SuppressDescription
HeaderName HEADER.html
Quote:
* Is there any evidence in the web server log files (errors are often in a separate log file), maybe file locations looking wrong or folders missing in the file paths?
We don't have access to real-time log files. We do have daily archived log files. If you want we could send you one to analyze.
Xyzzy is offline   Reply With Quote
Reply

Thread Tools


Similar Threads
Thread Thread Starter Forum Replies Last Post
Mersenneforum Art Gallery Orgasmic Troll Lounge 4 2020-12-01 08:33
The mersenneforum First 300 ewmayer Lounge 15 2012-08-27 18:35
HELP!! Can't Log In to mersenneforum Unregistered Information & Answers 8 2010-09-06 18:24
p95v2511.zip from mersenneforum.org Unregistered Information & Answers 2 2010-03-31 15:43
archives of mersenneforum.org? masser Forum Feedback 2 2007-12-27 15:34

All times are UTC. The time now is 11:21.

Fri Apr 23 11:21:42 UTC 2021 up 15 days, 6:02, 0 users, load averages: 1.11, 1.45, 1.57

Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2021, Jelsoft Enterprises Ltd.

This forum has received and complied with 0 (zero) government requests for information.

Permission is granted to copy, distribute and/or modify this document under the terms of the GNU Free Documentation License, Version 1.2 or any later version published by the Free Software Foundation.
A copy of the license is included in the FAQ.