Forum Moderators: phranque
It'd also be nice if the redirect directive could be used, so that the permanently moved (http 30....2?) code can be shown. I want them to see the new url, instead of being shown the old one, even though they're browsing the new one.
I've got extremely rudimentary understanding of Apache, so please speak slowly, using small words :)
Welcome to WebmasterWorld!
The documentation cited in our charter [webmasterworld.com] is a good place to start. You'll need to use mod_rewrite to do this redirect, and it's not a good idea to try to use mod_rewrite before understanding it; You can easily create code that will cripple your site, either by stopping it from serving files or by destroying your search engine rankings. Study and caution are advised.
Jim
<VirtualHost *:80>
ServerName pics.mydomain.com
RedirectPermanent / [media.mydomain.com...]
</VirtualHost>
This will redirect all requests, including files and directories, to the same resource on media.mydomain.com.
No you don't.
Frankly, I see a lot of posts offering mod_rewrite solutions to very simple problems that can be solved without mod_rewrite. Some posters see mod_rewrite as a solution to all problems, which is simply not true.
Mod_rewrite is a powerfull tool, but also very complex and I do feel it is being over-used. I don't know why... maybe because it's l33t or just becuase they don't know any better.
Reading Apache's docs offers many solutions without having to resort to mod_rewrite.
Welcome to WebmasterWorld!
I stand corrected. Many of the members posting here do not have access to the http.conf server configuration file. Therefore, their options are limited, and mod_rewrite in .htaccess is often the only solution. In other cases, the answers address a specific question in the context defined by that question.
Mod_rewrite is not required to solve the question posed in this thread if changes can be made at the server config level.
Jim
And ran it through the tester. Got this:
Syntax error.
Redirect to non-URL. What on earth?
I do have full access to this machine, as it physically lives with me, so edit rights for the server aren't an issue, but the hapless n00b of an administrator that I am does make things a bit more difficult.
Try:
Redirect permanent / [media.mydomain.com...]
hth,
Mike
In the examples of this command, I've noticed that none use the / as the first argument. Is that what's causing the problem?
[edited by: jdMorgan at 10:45 pm (utc) on Mar. 2, 2005]
[edit reason] Obscured specfics. [/edit]
When I go to the [pics.mysite.com,...] it gets properly redirected to [media.mysite.com....] However, when I try to access [pics.mysite.com...] the URL does not get redirected to the [media.mysite.com...] as I want.
Am I going to have to use mod_rewrite to do this?
Jim