Hey guys, l have a quick mod rewrite question that l was hoping someone could help me out with.
I've got wildcard subdomains setup in cpanel on my account.
I've got a directory called ebook, with several sub directories in it
/ebook/subdir1
/ebook/subdir2
/ebook/subdir3
Now l'm trying to setup a mod rewrite that will redirect:
subdir1.domain.com to domain.com/subdir1.
Now l'm using the following htaccess rules:
and it's working in this way:
subdir1.domain.org redirects the user to:
subdir1.domain.org/ebook/subdir1
Which works, but the url string looks like it does above and l was hoping that l could do the same, without having the actual URL show in the address bar.
Any help would be greatly appropriated!
I've got wildcard subdomains setup in cpanel on my account.
I've got a directory called ebook, with several sub directories in it
/ebook/subdir1
/ebook/subdir2
/ebook/subdir3
Now l'm trying to setup a mod rewrite that will redirect:
subdir1.domain.com to domain.com/subdir1.
Now l'm using the following htaccess rules:
Code:
RewriteEngine On RewriteCond %{HTTP_HOST} !^www\.domain\.com[NC] RewriteCond %{HTTP_HOST} ^([a-z0-9.-]+)\.domain\.com RewriteRule (.*) ebook/%1 [L,QSA]
subdir1.domain.org redirects the user to:
subdir1.domain.org/ebook/subdir1
Which works, but the url string looks like it does above and l was hoping that l could do the same, without having the actual URL show in the address bar.
Any help would be greatly appropriated!
Comment