new_coder
new_coder

Reputation: 103

I need .htaccess redirection to video.domain.com/date/id

I need to redirect;

http://video.domain.com/date/videoid  

to

http://www.domain.com/video/video.php?date=$date&videoid=$id

Thanks a lot...

Upvotes: 0

Views: 34

Answers (1)

hjpotter92
hjpotter92

Reputation: 80649

RewriteEngine On
RewriteCond %{HTTP_HOST} ^video\.domain\.com$ [NC]
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^([^/]+)/([^/]+)/?$ video/video.php?date=$1&videoid=$2 [L]

Do note that the above would work if both domain.com and video.domain.com are hosted on the same server.

Upvotes: 1

Related Questions