.htaccesshttp-redirecturl-rewritingbit.lygoo.gl

Rewrite htaccess, redirect if a "+" exisit in the url like goo.gl


my question is: how to redirect url when it contains a "+" like example.com.

A simple example:

http://example.com/gogl+ it will be redirected to http://example.com/info/gogl


Solution

  • All you need is this code in your .htaccess file:

    Options +FollowSymLinks -MultiViews
    # Turn mod_rewrite on
    RewriteEngine On
    RewriteBase /
    
    RewriteRule ^([^\+]+)\+$ info/$1 [L]