I am in the process of making major changes in a website. A lot of the content will be taken away, but i stll want to get all the visitors from google.
I have a forum in http://mysite.com/forum
But now I am taking it away and I want to redirect all those users to:
http://mysite.com/news.htm
would something like this be ok?
^/forum/(.*)(.htm|/|.php) /news.htm #.htm .php and / are the only possibilities for my forum's urls.
Also, don't know which chars to escape in htaccess regex...
Like... is this necessary?...
^/forum/(.*)(\.htm|\/|\.php) /news.htm
What about this?
^/forum/(.*) /news.htm
Is it dangerous in any way? why? how?
thanks in advance
question_ redirecting unsuccessful requests with htaccess
Moderator: General Moderators
Re: question_ redirecting unsuccessful requests with htaccess
Just make an index file in the forum/ directory with the following code:
<?php
header('Location: http://www.mysite.com/whatever/');
<?php
header('Location: http://www.mysite.com/whatever/');
Re: question_ redirecting unsuccessful requests with htaccess
Um... no that won't work unless someone requests either no file or index.php. If someone requests blah.php, they'll still get a 404 error....samb0057 wrote:Just make an index file in the forum/ directory with the following code:
<?php
header('Location: http://www.mysite.com/whatever/');
...Which is exactly what you should be looking into ~pedrotuga. Do a Google search for something along the lines of 404 .htaccess redirect
Real programmers don't comment their code. If it was hard to write, it should be hard to understand.