Forum Moderators: phranque
[mailmanager.companyname.com...]
I'd like this domain to read from
[companyname.com...]
So I'm wondering how I would amend the htaccess file to give this instruction.
Options +FollowSymLinks -MultiViews
RewriteEngine on
RewriteRule ^(.*)/$ index.php?id=$1 [NC]
RewriteCond %{REQUEST_URI}!(\.[^/]*¦/)$
RewriteRule (.*) [companyname.com...] [R=301]
ErrorDocument 404 /index.php?id=404 [NC]
For more information, see the documents cited in our forum charter [webmasterworld.com] and the tutorials in the Apache forum section of the WebmasterWorld library [webmasterworld.com].
Jim
[edited by: jdMorgan at 8:05 pm (utc) on May 25, 2007]
been playing around wit this for some time now, latest effort was
Options +FollowSymLinks -MultiViews
RewriteEngine on
RewriteRule ^(.*)/$ index.php?id=$1 [NC]
RewriteCond %{REQUEST_URI} !(\.[^/]*¦/)$
RewriteRule (.*) http://www.example.com/$1/ [R=301]
ErrorDocument 404 /index.php?id=404 [NC]
RewriteCond %{HTTP_HOST} ^enews.example.com$ [OR]
RewriteCond %{HTTP_HOST} ^www.enews.example.com$
RewriteRule ^(.*)$ http://www.example.com/enews/ [R,L]
if I request enews.example.com I encounter a "server cannot be found....."
and now also when I'm requesting www.example.com/home/ I'm getting internal server error
any suggestions on alternatives?
[edited by: jdMorgan at 6:31 pm (utc) on May 19, 2007]
[edit reason] Example.com [/edit]
You need to configure an A record in your DNS zone file to point wildcard subdomains to your server's IP address.
If you do not have a unique IP address for your site, you will also need to define the new hostnames (subdomains) in the server configuration. You may be able to do this with a control panel, or your host may do it for you. Or they may refuse.
> and now also when I'm requesting www.example.com/home/ I'm getting internal server error
Check your server error log for more information.
Also, are you sure you want an external redirect in your last rule? It will show the /enews subdirectory in the visitor's address bar, and this URL will also be indexed in the search engines. Most of the time for cases like this, an internal rewrite is used instead.
Jim
[edited by: jdMorgan at 6:33 pm (utc) on May 19, 2007]