- 0
[APACHE] .htaccess subdomain redirect not working
-
Recently Browsing 0 members
- No registered users viewing this page.
-
Similar Content
-
- 0 replies
- 5 views
-
- 0 replies
- 8 views
-
Save 95% off the Complete Big Data eBook & Video Course Bundle
By News Staff,
- neowin deals
- sponsored
- (and 14 more)
- 0 replies
- 235 views
-
This Complete Machine Learning A to Z Bundle was $891 - now only $35
By News Staff,
- neowin deals
- machine learning
- (and 14 more)
- 1 reply
- 177 views
-
- 0 replies
- 467 views
-
Question
Gone
Hello all!
After GoDaddy gave me the finger when my Wordpress site was hacked and a trojan was uploaded (apparently basic web hosting SLA doesn't include restoration to their previous backups without a nice fee), I decided to use my own VPS with AWS Lightsail (It's cheaper and easier to set up compared to AWS EC2).
Anyway, I am trying to redirect the subdomain mail.domain.com to domain.com/mail (with URL masking, showing only mail.domain.com/pages), but the configuration is not working.
Below is a copy of my .htaccess file:
# Enable .htaccess files RewriteEngine on RewriteBase / # Redirect mail.domain.com to domain.com/mail/, as well as any subdomain.domain.com to domain.com/subdomain RewriteCond %{HTTP_HOST} !^www\. RewriteCond %{HTTP_HOST} ^([^\.]+)\.domain\.com$ [NC] RewriteRule ^(.*)$ http://domain\.com/%1 [L,R]
Also, I have set AllowAccess all in my httpd.conf file.
I am using Amazon's AMI, which apparently is based off CentOS.
Thanks for the help all, I have tried several different ways from different sites and nothing works. I still do not completely understand this as I never had a need to do this until now.
Link to comment
https://www.neowin.net/forum/topic/1318670-apache-htaccess-subdomain-redirect-not-working/Share on other sites
1 answer to this question
Recommended Posts