URL rewriting for sub-domain
Hello,
I on a Linux server with Apache / PHP. My PHP app is available at http://myapp.mydomain.com myapp is a virtal host (pointing on my server to /var/www/myapp ) I also add a DNS inscription for newname.mydomain.com so my app is now also available using http://newname.mydomain.com I would like that when a user write http://myapp.mydomain.com the url automatically change (in the browser) to http://newname.mydomain.com because I'd prefer users use newname instead of myapp. What's the best way to do this ? Kind regards Sebastien |
|
You could also do this in PHP
PHP Code:
|
Sorry but I made a mistake, its not Rewrite /* its RedirectMatch /*
|
Thanks
I prefer not to modify the PHP code because the app has proprietary code. Is it possible to at the RedirectMatch in a .htaccess at the root of my app. |
Yes, you can place RedirectMatch's in your .htaccess files. They act recursively, and can be redefined at a lower level in the directory (web space) tree.
|
Thanks
I'll put the RedirectMatch in the .htaccess |
All times are GMT -5. The time now is 12:15 PM. |