newscoop and Apache mod_rewrite directives
  • I posed this question in a comment on one of my previous threads but there were no further replies, so I'll ask it as it's own thread.

    Does Newscoop have built in rewriting that might conflict with mod_rewrite directives? I have been trying to rewrite simple example.com/page formated url to the whole newscoop url up to/including the article number but while other redirects I have added, from a previously used domain to the current one, are funtioning fine, these are not redirecting and are simply 404ing. 
  • 7 Comments sorted by
  • The rewrite rules in Newscoop basically says to redirect all admin stuff to admin.php and everything else to index.php, except some files and directories. 

    Can you post an example of what you are trying to do? 
  • I'm trying to clean up the url display for a series of static pages so they display as mysite.com/<language_code>/<page_title> rather than mysite.com/<language_code>/<issue>/<section>/<article_number>/<page_title>

    Here is an excerpt from my /etc/apache2/httpd.conf file, where I place rewrites and redirects.

    <Directory /var/www/newscoop>
    RewriteEngine on
    ...
    # static page rewrites
    RewriteRule ^en/rss[/]?$ /en/2013_02/rss [NC,L]
    ...
    </Directory>
    Post edited by captain stupy at 2014-03-12 19:59:49
  • No, that will not work. Newscoop uses the requested URL to determine what to show, so if you change that it will stop working. 
  • thanks for the response/info.
  • What would be the preferred workaround?
    Should we patch Newscoop to "respect" the rewritten URL, or would it be best to use a outside router/proxy?
    I've seen a discussion from 2012 about how to deal with legacy URLs, which would be also applicable, but the option disappeared from the Admin interface at some point.

  • Sorry for jumping in. Is it possible to rewrite only the topics in a publication with only one edition?

    Example:

    RewriteRule ^es/culture /es/sectionname/?tpl=9&tpid=29

    Only this topic URL, not the article URL.


  • You can use [R=301] and the browser will redirect and visit the correct page, but the URL in the browser window will also update to the one that Newscoop actually uses rather than the one you set in Apache.