Skip to content

Instantly share code, notes, and snippets.

@cooljl31
Last active April 26, 2022 09:06
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 cooljl31/4b7af49dd4c8552f5e5223f370ff6e3f to your computer and use it in GitHub Desktop.
Save cooljl31/4b7af49dd4c8552f5e5223f370ff6e3f to your computer and use it in GitHub Desktop.
Rewrite Rules in .htaccess files
RewriteEngine On
Options +FollowSymLinks
RedirectMatch 301 ^([^_]*)_([^_]*)_([^_]*)_([^_]*)_([^_]*)_([^_]*)_([^_]*)_([^_]*)_(.*)$ https://www.shipcloud.io/$1-$2-$3-$4-$5-$6-$7-$8-$9/ [E=underscore_replacer:Yes]
RedirectMatch 301 ^([^_]*)_([^_]*)_([^_]*)_([^_]*)_([^_]*)_([^_]*)_([^_]*)_(.*)$ https://www.shipcloud.io/$1-$2-$3-$4-$5-$6-$7-$8/ [E=underscore_replacer:Yes]
RedirectMatch 301 ^([^_]*)_([^_]*)_([^_]*)_([^_]*)_([^_]*)_([^_]*)_(.*)$ https://www.shipcloud.io/$1-$2-$3-$4-$5-$6-$7/ [E=underscore_replacer:Yes]
RedirectMatch 301 ^([^_]*)_([^_]*)_([^_]*)_([^_]*)_([^_]*)_(.*)$ https://www.shipcloud.io/$1-$2-$3-$4-$5-$6/ [E=underscore_replacer:Yes]
RedirectMatch 301 ^([^_]*)_([^_]*)_([^_]*)_([^_]*)_(.*)$ https://www.shipcloud.io/$1-$2-$3-$4-$5/ [E=underscore_replacer:Yes]
RedirectMatch 301 ^([^_]*)_([^_]*)_([^_]*)_(.*)$ https://www.shipcloud.io/$1-$2-$3-$4/ [E=underscore_replacer:Yes]
RedirectMatch 301 ^([^_]*)_([^_]*)_(.*)$ https://www.shipcloud.io/$1-$2-$3/ [E=underscore_replacer:Yes]
RedirectMatch 301 ^([^_]*)_(.*)$ https://www.shipcloud.io/$1-$2/ [E=underscore_replacer:Yes]
RewriteCond %{HTTP_HOST} ^shipcloud\.io$ [NC,OR]
RewriteCond %{HTTP_HOST} ^www.shipcloud\.io$ [NC]
RewriteRule ^(.*) https://www.shipcloud.io%{REQUEST_URI}/ [R=301,L]
#docker pull madewithlove/htaccess-cli
#docker run --rm -v $PWD:/app madewithlove/htaccess-cli shipcloud.io/de/company/press/releases/hello_und_asendia -e https://www.shipcloud.io/de/company/press/releases/hello-und-asendia/
#https://www.shipcloud.io/de/company/press/releases/shipcloud_und_asendia_starten_grenzueberschreitende_kooperation
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment