XAMPP alias or rewrite?

XAMPP alias or rewrite? - 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 XAMPP alias or rewrite? error on your web browser. Problem :


I have a site running on W2012 with XAMPP. I have a live site that was in subfolder /foo. It now needs to be changed to /home.



I set up an alias 

Alias /foo "C:/xampp/htdocs/home"


This takes users from foo-->home... however they lose the page that they were going to. The problem is a lot of the pages on foo were privately given so we would be expecting users to understand that they need to copy their page to the new url. I need a user going to foo/client-demo to go automatically to home/client-demo.



Addition: Yesterday I set up a redirect.



Redirect foo/client-demo home/client-demo


This works. Then I thought that the reason the Alias isn't working is my SSO. I have an SSO SAML login script that redirects the user the their entry page. So if the user starts at foo/xyz the alias kicks them to home/xyz (maybe on the xyz) and then they hit the login script and go back to their referral page.


Solution :


... however they lose the page that they were going to.




I'm not sure what you mean by this - they shouldn't "lose" anything? However, the URL in the address bar will not be updated - if that is what you are implying? An Apache Alias converts a URL to a server-side filesystem path (usually to allow access to files located outside of the document root) - it does not manipulate the URL.



It sounds like you want an external redirect (301 - permanent). For example, using mod_alias (prefix matching):



Redirect 301 /foo /home


This assumes that you are not already using mod_rewrite to process redirects/rewrites (such as with WordPress). If you are already using mod_rewrite for this purpose then you must also use mod_rewrite for this redirect, since the order of execution might not be as expected. For example:



RewriteRule ^/?foo(.*) /home$1 [R=301,L]

We hope that this article has helped you resolve the redirects, apache2, xampp error in your web browsers. Enjoy browsing the internet uninterrupted!

Comments

Popular posts from this blog

How to redirect to any domain [duplicate]

"302 found" for index page bad for SEO?

Create redirect from url like www.example.us/?p=100&option=