My objective here is to ensure that my existing /taxonomy/term/%/feed and /planet/feed links still work correctly so I won't lose any RSS feed subscribers to my website. As I have mentioned previously, Tome will automatically create an index.html page when there is no file extension on a path. So it's best to add extensions then! Navigate to /admin/structure/views and edit Taxonomy term then click the feed display. Click on the path and edit according to my first screenshot above and save. I also have a Drupal Planet feed which acts on my frontpage but with tag filters, so I repeated those steps and added a feed.rss path to that too.
We aren't done yet though - my web server config needs to be changed too so that the RSS pages can be served up correctly.
# Default server configuration # server { listen 80 default_server; listen [::]:80 default_server; # SSL configuration root {{ path_to_your_docroot }}; server_name {{ your_server_name }}; location ~ (/planet/feed|/taxonomy/term/\d+/feed) { index feed.rss; } location / { index index.html; # First attempt to serve request as file, then # as directory, then fall back to displaying a 404. try_files $uri $uri/ =404; } # deny access to .htaccess files, if Apache's document root # concurs with nginx's one # location ~ /\.ht { deny all; } }
<VirtualHost *:80> # change this to 443 is you are using ssl <Directory "{{ path_to_your_docroot }}/planet/feed"> DirectoryIndex feed.rss </Directory> <Directory ~ "{{ path_to_your_docroot }}/taxonomy/term/[0-9]+/feed"> DirectoryIndex feed.rss </Directory> ServerName {{ your_server_name }} DocumentRoot "{{ path_to_your_docroot }}" DirectoryIndex index.html # Comment out the block below for SSL #SSLEngine on #SSLCertificateFile "/path/to/www.example.com.cert" #SSLCertificateKeyFile "/path/to/www.example.com.key" <Directory "{{ path_to_your_docroot }}"> AllowOverride All </Directory> # Logs Errorlog ${APACHE_LOG_DIR}/static.error.log CustomLog ${APACHE_LOG_DIR}/static.access.log combined </VirtualHost>
mods-available/mime.conf
AddType application/xml .xml .rss
The picture above provides the evidence the fixes worked!