I’m running Apache2 webserver on linux
My domain is peku33.net
In apache configuration I’ve set DomainAlias to *.peku33.net
In my public_html directory I have:
SomeSite.php
SomeOtherSite.php
SomeotherSiteEtc.php
I want to redirect
SomeSite.php -> peku33.net/SomeOTHERText/
SomeOtherSite.php -> mysite.peku33.net/SomethingElse/
SomeotherSiteEtc.php -> mysubdomain.peku33.net/Blablabla/Blabla/
I also want to disable direct access to theese files (calling http://peku33.net/SomeSite.php will return 304 or 301 code with approperiate Location: )
Thanks for your replays!
Simple enough, just stick something along the following lines in either a .htaccess file in the document-root directory of your sites (not that efficient as Apache will read and parse the file on every request, also assumes directory Includes have been permitted in the httpd.conf for your sites document root), or preferably in the Virtualhost definition within your Apache’s httpd.conf, or associated included .conf :
Note:
The Apache mod_rewrite documentation is worth a read if your unclear as to what the above rules do, or if you want something a little more abstract consider the following post.