.htaccess Redirect

Assuming you have changed your permalinks in WordPress (under Settings > Permalinks), as mentioned earlier, then you can redirect your old URLs en masse (in order to preserve SEO) with something like the following at the top of your .htaccess file, using mod_rewrite: RewriteRule ^([\w-]+)-\d{7,}\.html$ /$1/ [R=302,L] This will redirect URLs of the form /%postname%-%monthnum%%year%%post_id%.html … Read more

How to redirect URL with subfolder to the same URL but without subfolder?

Assuming you have already moved your site from the /blog subdirectory to the document root and changed the URL structure within WordPress itself, so the /blog subdirectory is not included in all your internal links, then you can either do a simple redirect (using mod_rewrite) in the /blog/.htaccess file (preferable): RewriteEngine On RewriteRule (.*) /$1 … Read more

htaccess redirect invoice.php to /client/invoice.php

So, you just want to inject a /client subdirectory, for specific URLs, from the document root. You can do this using mod_rewrite, at the top of your .htaccess file (before the WordPress front-controller). For example: RewriteRule ^view(invoice|ticket)\.php$ /client/$0 [R=302,L] This will redirect either /viewinvoice.php or /viewticket.php to /client/viewinvoice.php and /client/viewticket.php respectively. The query string is … Read more

How to use Regex to add to a url?

You could do this a couple of ways, if you have access to your .htaccess-file & are comfortable editing it: https://superuser.com/questions/155139/htaccess-301-redirect-with-regular-expressions https://stackoverflow.com/questions/16665672/using-regular-expression-in-htaccess-for-301-redirects You can workout a regex to do it… RedirectMatch /example-here/(.+) http://www.exapmles.com/blog/example-here/$1 [R=301,L] or use a redirect plugin to create the redirects you want. here’s a couple options: https://en-ca.wordpress.org/plugins/redirection/ https://en-ca.wordpress.org/plugins/simple-301-redirects/ https://en-ca.wordpress.org/plugins/safe-redirect-manager/

Any action in wordpress redirects me to home page

After Spending many hours on this seemingly insoluble problem, as it turned out the issue was generated from mod security being enabled. Although, I disabled it myself from cpanel, it had to be turned off from server and a level deeper in hosting as well. So if you encountered this knot contact your web host … Read more

How to add new redirection on wordpress site

To redirect just those 3 URLs (with variable ticket number) on the support subdomain then you can do something like the following before the WordPress front-controller (assuming the support subdomain resolves to the same place and is probably handled by WP) using mod_rewrite, in the root .htaccess file: RewriteCond %{HTTP_HOST} ^support\.example\.com [NC] RewriteRule ^((?:a/)?ticket/\d+)?$ https://support.example1.com/$0 … Read more