PDA

View Full Version : .htaccess redirect


bskr84
01-08-2015, 05:25 AM
Hello,

I want to make a redirect like this through .htaccess:

My main domain name: abc.com

When a user enters the URL(http://z.abc.com) in the browser

then redirect to this url http://www.abc.com/forumdisplay.php?f=262

how can i do that :eek:

ForceHSS
01-08-2015, 08:43 AM
RewriteEngine on
RewriteCond %{HTTP_HOST} ^z.abc.com (http://z.abc.com) [NC]
RewriteRule ^(.*)$ http://www.abc.com/forumdisplay.php?f=262
/$1 [R=301,L]

backup first has not been tested

RichieBoy67
01-08-2015, 08:59 AM
Or a simple 301 would work

Redirect 301 / http://www.abc.com/forumdisplay.php?f=262

bskr84
01-08-2015, 10:11 PM
RewriteEngine on
RewriteCond %{HTTP_HOST} ^z.abc.com (http://z.abc.com) [NC]
RewriteRule ^(.*)$ http://www.abc.com/forumdisplay.php?f=262
/$1 [R=301,L]

backup first has not been tested

Or a simple 301 would work

Redirect 301 / http://www.abc.com/forumdisplay.php?f=262

but, the browser notice "Error 105 (net :: ERR_NAME_NOT_RESOLVED): Unable to locate this server."
:confused: