How do I redirect a specific subdomain to a subdirectory using .htaccess?
-
I currently have my main site at http://mysite.com which goes to /var/www/mysite/. I would like to point the subdomain http://images.mysite.com to /var/www/mysite/images (http://mysite.com/images). How do I do this using .htaccess?
-
Answer:
if you need help with redirects try out this blog which gives a step by step guide to the htaccess file: http://www.saelboat.com/blog/how-to-guides/2011/htaccess-file-regex-guide-part-1-simple-url-to-url-301-redirects-88
Saeley Ewan Jnr Johnson at Quora Visit the source
Other answers
Hi, I just stumbled over your question, and as I have a similar problem, I try to answer with what I know about this topic: In your .htaccess you have to turn on the RewriteEngine to use Apaches mod_rewrite module (the module has to be loaded from your webserver). So I guess that is how your .htaccess could look like: RewriteEngine on RewriteCond %{HTTP_HOST} ?images\.mysite\.com$ RewriteRule ^(.*)$ images/$1 [NC] The NC rule means No Case. Hope this works for you.
Christian Baumgartner
I have a mobile site located under a subfolder. I want a link at the bottom that will allow the user to view the desktop version. How could I do this?
Justin Wegner
Related Q & A:
- How do I calculate a xyz-position of a GPS-position relative to an other GPS-position?Best solution by Geographic Information Systems
- How do I check a type is of a specific template?Best solution by Stack Overflow
- How can I burn a .rmvb file onto a DVD for viewing on a regular DVD player?Best solution by Yahoo! Answers
- How can I block a specific web page?Best solution by Yahoo! Answers
- How can I email a photo on Yahoo email without using an attachment?Best solution by Yahoo! Answers
Just Added Q & A:
- How many active mobile subscribers are there in China?Best solution by Quora
- How to find the right vacation?Best solution by bookit.com
- How To Make Your Own Primer?Best solution by thekrazycouponlady.com
- How do you get the domain & range?Best solution by ChaCha
- How do you open pop up blockers?Best solution by Yahoo! Answers
For every problem there is a solution! Proved by Solucija.
-
Got an issue and looking for advice?
-
Ask Solucija to search every corner of the Web for help.
-
Get workable solutions and helpful tips in a moment.
Just ask Solucija about an issue you face and immediately get a list of ready solutions, answers and tips from other Internet users. We always provide the most suitable and complete answer to your question at the top, along with a few good alternatives below.