Hi,

I'm in need of assistance with mod_rewrite. Currently, I've a folder at www.domain.com/folder. I need to leave the files where they are, but have the address bar in the browser appear as someothername.domain.com

Any help would be greatly appreciated!

I should mention that I've already got a few .htaccess rules in place, as shown here:

Options +FollowSymLinks

RewriteEngine On
RewriteCond %{SCRIPT_FILENAME} !-f
RewriteCond %{SCRIPT_FILENAME} !-d
RewriteRule ^(.+)$ index.php?$1 [QSA,L]

Thanks in advance,
-Ray

The problem is more complex than a mod_rewrite recipe.

Rewriting the URL is fairly easily done:

RewriteCond %{HTTP_HOST} ^www\.domain\.com$ [NC]  
RewriteRule .? http://someothername.domain.com%{REQUEST_URI} [R=301,L]

So when the browser requests a URL at www.domain.com, the server responds with a permanent redirect (a 301 response) that in effect says, “Oh, for that, you need to go to someother.domain.com instead, using the same URI.”

The browser happily obliges, requesting a URL at someother.domain.com.

The real question is: what’s at someother.domain.com? Is that domain set up? Is the a webserver set up to respond at that address? If not, that’s a different issue—a subdomain will have to be set up, and a webserver set up to respond to web requests for that domain.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.