user3599061
user3599061

Reputation: 53

.htaccess redirect a subdomain address to that of main domain

I have the following address

http://subdomain.example.com/content/category/25/72/138

I would like to redirect it to

http://example.com/index.php?option=com_content&view=category&id=73&Itemid=132

How can I do that?

Upvotes: 1

Views: 30

Answers (1)

Vlad DX
Vlad DX

Reputation: 4730

You need something like that in your .htaccess:

RewriteEngine On
RewriteRule ^com_([^/]*)/25/([^/]*)/([^/]*)/([^/]*)$ /index.php?option=$1&view=$2&id=$3&Itemid=$4 [L]`

But why did you skip 25 in the URL?

Upvotes: 1

Related Questions