PDA

View Full Version : Quick htaccess question


pewa
01-04-2020, 08:11 PM
Hi,

I have moved my forum from 'domain.com/forum' to only 'domain.com'. The URL structure is the same besides that.

How do I redirect(301) all traffic using htaccess? What to write and where to put the file.

Thanks!

--------------- Added 1578176664 at 1578176664 ---------------

This seems to work:

Options +FollowSymLinks
RewriteEngine On
RewriteRule ^forum/(.*)$ /$1 [R=301,NC,L]

Placed in public_html root

Hostboard
01-04-2020, 08:48 PM
To redirect the entire site, place the .htaccess file at the root of your web folder.


Redirect 301 / http://newsite.com/

pewa
01-05-2020, 10:51 AM
To redirect the entire site, place the .htaccess file at the root of your web folder.


Redirect 301 / http://newsite.com/


Ok, does it matter if I do It like that or like my example above?

Dave
01-05-2020, 01:00 PM
I recommend using the one you use now as it will also redirect the user to the proper URL without "/forum".