.htaccess rewrite , parked domain on another site to read the proper domain name
.htaccess rewrite , parked domain on another site to read the proper domain name -
Solution :
Additionally, if you would like to do some further testing, give the htaccess tester tool a try. It allows you to specify a certain URL as well as the rules you would like to include and then shows which rules were tested, which ones met the criteria, and which ones were executed.
.htaccess files are extremely useful in many cases for users who either do not have root permissions or for users who simply aren't comfortable in making changes in their web server's configuration file. Trying to debug .htaccess not working isn't always the easiest thing to do, however, hopefully by checking the discuss below mentioned about domains, htaccess, mod-rewrite, url-rewriting, .htaccess common problems as well as the troubleshooting tips, you'll have a better grasp on what you may have to modify to get your .htaccess file running smoothly.Problem :I have a parked domain example.co.uk on another domain name web-space in a folder and need to rewrite the domain name in the browser URL as it currently shows the other domain name while browsing and I need it to read example.co.uk.
When parking the domain the ISP automatically added this which works although displays another domain name.
RewriteCond %HTTP_HOST ^example.co.uk$ [OR]
RewriteCond %HTTP_HOST ^www.example.co.uk$
RewriteRule ^/?$ "http://www.otherdomain.eu/myfolder" [R=301,L]
Remove the R=301 from the end, so it's just:
RewriteRule ^/?$ "http://www.otherdomain.eu/myfolder" [L]
That directive tells Apache to serve an HTTP 301 (Permanently Moved) response, and hence the browser is served the rewritten location. Without it, Apache just silently rewrites the request and serves the content in the rewritten directory with a standard HTTP 200 response.
Comments
Post a Comment