WordPress simple Url Rewrite

Theme’s functions.php is not the best place to do these sort of URL rewrites.

Why?: because in that case WordPress will be fully loaded and then redirected to a new link and then fully loaded again to show the page. That’s a lot of delay for a page view.

Instead of that, you may use URL rewrite in .htaccess (assuming your web server is Apache):

<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /

# YOUR CUSTOM REDIRECT
RewriteRule ^DN1$ http://www.mysite.it/chi-siamo [L,R=301,NC]

# default WordPress rules
RewriteRule ^index\.php$ - [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /index.php [L]
</IfModule>