Redirect from /community/ tot Root

Robru

Well-known member
Hey,

The forum has been moved from the 'community' folder to the root.
Of course the forum is still full of references to the 'community' folder.

This will probably have to be done with lines in the .htaccess file.

Can an expert here please make these lines for me, and tell me which .htaccess file to put them in.

Old URL: https://www.caviaforum.nl/community/
New URL: https://www.caviaforum.nl/
 
Code:
RewriteRule ^/?community/(.*)$ /$1 [R=301,L]
should work

put it in the core xf htaccess file in root after rewrite engine on and before the xf default rules
 
Also, you may want to run a db update to remove 301s internally.

back up your DB and TEST THIS before running on live data.

Code:
UPDATE xf_post SET message = REPLACE(message, 'caviaforum.nl/community/', 'caviaforum.nl/');

you may also want to run this a few times if you have mixed www or http/https in there. just make sure your replacement is even for the context.

using just the suffix above (domainname, no http or www) will leave whatever was posted as-is.
 
Last edited:
@bransol Thank you very much for your help!

phpmyadmin ask for a 'end quote', but I don't know where exactly to put it in the code line.
Code:
'UPDATE xf_post SET message = REPLACE(message, 'caviaforum.nl/community/', 'caviaforum.nl/');
 
Top Bottom