Redirect www to subdomain with masking

I'm totally stuck here, and I've read and tried countless suggestions, but it still doesn't work. I would really appreciate a custom solution to this.

I have a wordpress site installed at subdomain wordpress.domain.com what is actually a subdirectory located in \wordpress.

While my redirect is working, and users are forwarded from www to wordpress subdomain, I need the users not to see the wordpress.domain.com - i.e. I need them to see only www.domain.com all the time.

This is what I have in my .htaccess file, but it does nothing:

RewriteEngine On
RewriteCond %{HTTP_HOST} ^(www\.)?domain\.com$ [NC]
RewriteRule ^wordpress/(.*)$  http://wordpress.domain.com/$1 [L]

For the reference here's the full htaccess file:

RewriteEngine On
RewriteBase /
RewriteRule ^index\.php$ - [L]

#Options +FollowSymLinks
#RewriteCond %{HTTP_HOST} ^wordpress.domain.com [NC]
#RewriteRule ^(.*)$ http://www.domain.com/$1 [L,R=301]


# uploaded files
RewriteRule ^([_0-9a-zA-Z-]+/)?files/(.+)
wp-includes/ms-files.php?file=$2 [L]

# add a trailing slash to /wp-admin
RewriteRule ^([_0-9a-zA-Z-]+/)?wp-admin$ $1wp-admin/ [R=301,L]



RewriteCond %{REQUEST_FILENAME} -f [OR]
RewriteCond %{REQUEST_FILENAME} -d
RewriteRule ^ - [L]
RewriteRule  ^[_0-9a-zA-Z-]+/(wp-(content|admin|includes).*) $1 [L]
RewriteRule  ^[_0-9a-zA-Z-]+/(.*\.php)$ $1 [L]
RewriteRule . index.php [L]

Answers


Options +FollowSymLinks
RewriteEngine on
RewriteCond %{HTTP_HOST} ^wordpress.domain.com [NC]
RewriteRule ^(.*)$ http://domain.com/$1 [L,R=301]

Need Your Help

Sorting/Ordering MySQL with two fields

mysql sql database

I have a table sort of like this: