In my httpd.conf file of my apache server(on windows7), I used LoadModule alias_module modules/mod_alias.so
And then I modified the httpd.conf with the following:
<IfModule alias_module>
Alias /b /blog
ScriptAlias /cgi-bin/ “cgi-bin/”
</IfModule>
After I restarted the server and type the localhost/b in my address bar,however,it did not redirect to the localhost/blog.I don’t konw why.Can you help me, Any help is greatly appreciated
Alias declarations aren’t the same as redirects.
tells Apache to make the files that exist on your file system under the path
/blog(which doesn’t mean much on Windows) available at the URLhttp://myserver.com/b, i.e. a request forhttp://myserver.com/b/something.htmlwill try to return the content of the file/blog/something.htmlfrom your filesystem, failing if that file does not exist – the browser address bar will still sayhttp://myserver.com/b/something.html.It sounds like what you’re after is
In this case, a request for
http://myserver.com/b/something.htmlwill result in an HTTP redirect, the browser’s address bar will change to sayhttp://myserver.com/blog/something.html.Of course, you then need to ensure that
/blogresolves appropriately, which may require its ownAliasif it’s not under theDocumentRoot.