I am wondering wether it’s possible to use Apaches
.htaccessto rewrite a folder name – using a WordPress function.
Lets say I have a url like:
Now I want to rewrite the url to (for example)
folder1is an existing url. How can I change it to
The following I found “somewhere in the internet”:
<IfModule mod_alias.c> RedirectMatch 301 /testing/folder2/(.*) /folder1/folder2/$1 </IfModule>
I need it as a PHP function to use it in WordPress.
You can do rewrites in wordpress by using the