.htaccess redirect url to a subfolder on a subdomain with exceptions
.htaccess redirect url to a subfolder on a subdomain with exceptions - If a page has internal and external outgoing links to redirecting URLs, it’s returning 3xx (301, 302, etc.) HTTP status codes standing for redirection. This issue means that the page does not exist on a permanent or temporary basis. It appears on most of the popular web browsers, usually caused by a misconfigured website. However, there are some steps you can take to ensure the issue isn’t on your side. You can find more details about redirecting URLs by reading the Google Search Central overview. In this article, we’ll go over how you can fix the .htaccess redirect url to a subfolder on a subdomain with exceptions error on your web browser. Problem :
Solution :
We hope that this article has helped you resolve the htaccess, redirects, url error in your web browsers. Enjoy browsing the internet uninterrupted!
I have a CMS installed on a subdomain (say blog.domain.com). I created a site on it but the site can be accessed at (blog.domain.com/sites/mysite). I also have to use other links like blog.domain.com/#/create and blog.domain.com/#/login/mysite
How do I achieve the following things:
- Redirect all requests to
blog.domain.comtoblog.domain.com/sites/mysiteWITHOUT changing the URL. - Still have access to
blog.domain.com/#/createandblog.domain.com/#/login/mysite
I know there are a lot of answers on .htaccess redirects but I cant find the complete answer for both my questions above.
In your subdomains document root, try the following:
RewriteEngine On
RewriteCond %REQUEST_URI !^/sites/mysite/
RewriteRule (.*) sites/mysite/$1 [L]
Since this is an internal rewrite, you don't need to do anything with regards to #2
Comments
Post a Comment