Skip to content

Instantly share code, notes, and snippets.

@jasraj
Created January 9, 2017 11:10
Show Gist options
  • Save jasraj/a1bbd7c2cb031796688e4233520a46a1 to your computer and use it in GitHub Desktop.
Save jasraj/a1bbd7c2cb031796688e4233520a46a1 to your computer and use it in GitHub Desktop.
HAProxy: Redirect "fake" SPA URLs to /, files (with extension) get passed through to Apache
# Redirect all fake URLs (that don't contain a .) to / (anything after ? is OK, but not sent to Apache)
# URL request format: GET /requested/url?optionalParams HTTP/1.1
reqirep ^([^\ ]*\ /)(([^.]*)|([^.]*\?.*))(\ .*)$ \1\5
@PuKoren
Copy link

PuKoren commented Apr 24, 2019

Thanks ! Very helpful and works well 👍

@jserras
Copy link

jserras commented Feb 14, 2020

Greetings,

I believe you are missing a backslash escape before the slash of the 1st group.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment