Skip to content

Instantly share code, notes, and snippets.

@therealmarv
Last active August 29, 2015 14:24
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save therealmarv/69d53b9241fd4fa7fcde to your computer and use it in GitHub Desktop.
Save therealmarv/69d53b9241fd4fa7fcde to your computer and use it in GitHub Desktop.
PyBossa Rewrite Apache

Original nginx rewrite lines, just for reference!

location ~ /api/app {
        rewrite ^/api/app /api/project$1 permanent;
}

location ~ /app {
        rewrite ^/app(.*) /project$1 permanent;
}

First activate mod_rewrite on apache:

sudo a2enmod rewrite
sudo a2enmod actions 
sudo /etc/init.d/apache2 force-reload

Put this lines into .htaccess

RewriteEngine   on
RewriteRule     ^/api/app(.*)$ /api/project$1 [R=301,L]
RewriteRule     ^/app(.*)$ /project$1 [R=301,L]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment