Domain redirect and .htaccess file

331 views
Skip to first unread message

EdderShredder

unread,
Feb 20, 2018, 4:50:24 AM2/20/18
to AtoM Users
Hello.

We are shortening our domain name and making it more inclusive to our area.
I have tried to redirect the site via a .htaccess file in the /usr/share/nginx/atom folder with the following contents (minus our new domain.)

RewriteEngine on
RewriteBase /
RewriteRule (.*) http://www.newdomain.com/$1 [R=301,L]

The above code was recommended by the hosting provider.

The file was transferred over as a .htaccess file with no prefix and had its permissions changed to 0664.

It is not redirecting. I tried a couple of things including a server restart to no avail.
Am I inserting the file in the wrong directory?

Our atom install was created following the documentation on https://www.accesstomemory.org/en/ for AtoM 2.1 and Ubuntu 14.04 LTS.
The documentation was followed to the letter and our install is on a single server.

Thanks 
Ed

Dan Gillean

unread,
Feb 20, 2018, 10:47:35 AM2/20/18
to ICA-AtoM Users
Hi Ed, 

This type of custom configuration is something that you might have more success posting in the Nginx user forum - however, I did a bit of searching on your behalf and found some promising leads. It looks to me like the best way to do this is to add a second server block directly in your nginx configuration file, with a permament redirect in the old block. See: 
You'll probably want to restart not just nginx, but also clear your cache and restart memcached and PHP-FPM (and clear your web browser cache as well), to ensure you are getting an updated version of the pages served to you when testing after the changes. On 14.04, the following commands will restart services and clear your application cache: 
  • php symfony cc
  • sudo service nginx reload
  • sudo service php5-fpm restart
  • sudo service memcached restart
Let us know if this helps! 

Cheers, 

Dan Gillean, MAS, MLIS
AtoM Program Manager
Artefactual Systems, Inc.
604-527-2056
@accesstomemory

--
You received this message because you are subscribed to the Google Groups "AtoM Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to ica-atom-users+unsubscribe@googlegroups.com.
To post to this group, send email to ica-atom-users@googlegroups.com.
Visit this group at https://groups.google.com/group/ica-atom-users.
To view this discussion on the web visit https://groups.google.com/d/msgid/ica-atom-users/8fae6f39-07fe-4b52-b7a2-a1b0862d9ecc%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

David Juhasz

unread,
Feb 20, 2018, 11:22:35 AM2/20/18
to ica-ato...@googlegroups.com
Hi Ed,

.htaccess files are used by Apache Web Server exclusively, they won't work with an Nginx server.

Cheers,
David

--

David Juhasz
Director, AtoM Technical Services Artefactual Systems Inc. www.artefactual.com

To post to this group, send email to ica-ato...@googlegroups.com.

--
You received this message because you are subscribed to the Google Groups "AtoM Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to ica-atom-users+unsubscribe@googlegroups.com.
To post to this group, send email to ica-atom-users@googlegroups.com.
Visit this group at https://groups.google.com/group/ica-atom-users.
Reply all
Reply to author
Forward
0 new messages