Htaccess.. changing the domain name - .htaccess

I have a big Joomla website that was moved from .com to .eu domain.
The sites are on one web server.
On the old website there are a lot of links that point directly to oldwebsite.com/somethinghere.
Is there a way with Htaccess file in the old domains folder to redirect
from oldwebsite.com/somethinhere to newwebsite.eu/somethinghere?
Or maybe a way to do this on the new website folder?
Thank you,
Chris.

There are many ways, some people recommend using RewriteEngine, but there is an easier way:
Redirect 301 / http://domain.eu/
This will automatically handle files in the domain -- for example, old.com/foo will be redirected to new.eu/foo
EDIT: Regarding "301", that is the code for a permanent redirect. There also exist temporary redirects (I believe the code is 302), but it sounds like what you need is exactly this - a permanent redirect.
EDIT2: Oh and, I think the / after domain.eu may be required, but I'm not 100% sure - doesn't hurt for it to be there, that's for sure! I know that because I use the same kind of a redirect on a production website.

Related

How do I redirect from the old domain to the new domain via an alias on the DNS of the old domain, using the .htaccess of the new one

Sorry if that question title doesn't make any sense but it pretty much captures where I'm at with my confusion here.
So I've worked on a site that we'll call new-site.com that is going to be taking over from an existing site that we'll call old-site.com
There's no cross-over between the sites necessarily, but the owners don't want the sites to both exist at the same time so they want old-site.com to redirect to new-site.com which seems fairly straightforward.
My thought process for doing this would be to add a simple redirect rule to the htaccess file of old-site.com that just forwards everything to new-site.com, job done.
What is actually going to happen is that the developer of old-site.com is saying that what we need to do is to hold all the redirects for old-site.com in the htaccess file in the public folder of new-site.com and that he will then 'alias' the old-site.com domain over to new-site.com via the old domain DNS.
This is super confusing to me and a little out of my comfort zone and I'm not sure how I'd go about writing my redirects. Should I include the full domain name for old-site.com in there every time because otherwise surely I'll end up in a redirect loop if I don't use the domain name and I want to go from old-site.com/about-us to new-site.com/about-us?
I hope that makes sense and that some more experienced hands know what I need to do and can help me understand a little better?
Thank you

Building new website on old domain name. How should I redirect the old site?

I recently moved a website to another domain, but I am keeping the original domain for a future website. The recently moved website is permanently moved, but I only want traffic to be redirected temporarily to the other domain.
I have read countless 301 vs 302 posts, articles, etc. and have failed to find any that address this particular situation. And no one answered this similar question:
Moving to a new domain and using the old one for a new website - how to handle 301 redirects?
But the difference with my question is: I don't even know that I should be using a 301 redirect for this. What's the best way to handle this situation in general?
301 Moved Permanently doesn't mean that the domain name should never be used again; it means that the content the user requested has moved permanently, which is exactly the situation you describe.
(308 Permanent Redirect is supposed to supplement 301, but it is sometimes treated oddly and doesn't work at all on Windows 7 or 8.1 under IE.)
When you decide to re-use the old domain for a new set of resources, you can simply stop redirecting away from it. By then you hope that people looking for the old resource have updated their bookmarks/links thanks to the 301. It might be polite to allow some duration of time for this transition to occur.
Neither 302 Found nor its replacement 307 Temporary Redirect is appropriate here, as both misrepresent the situation and do not signify that people should permanently look for the old content in the new location: they're going to be mighty confused when the original domain no longer redirects, allegedly the end of a temporary situation, but then also does not serve the expected content.
You can use the .htaccess file to redirect with 307 status code (the successor of 302 in HTTP/1.1)
Redirect 307 / http://other-domain/
Here's a link that you may find helpful. You can also redirect with 308 status code also as #István Rábel suggested

How can I display a subpage of my Silverstripe website as a subdomain?

I have a website build on Silverstripe 3.
Now I want that a user can enter the Subdomain URL info.mydomain.com and see the content of the page mydomain.com/subpage-url/. But without redirection. The subdomain URL should stay in their browser.
I already created the subdomain and let it point to the root directory of my website. As I understand it right I now need some rewrite conditions in my .htaccess file? And that is the point I struggle with. I googled a little bit and did some trail and fail but nothing seems to work. Maybe I understand it totally wrong, used the wrong rewrite conditions or insert them on the wrong place.. Maybe there are Silverstripe specific issues to pay attention to?
Long story short: I need help please!
As Robbie Averill pointed out in his comment, you could install the Subsites module. But you'd have to create a Subsite (eg. a separate site-tree) for every domain.
There's another module though, the homepagefordomain module. With that module you can specify one (or multiple) domains per page. When you visit one of these domains, the page that was specified as home-page for that domain will show up. I think this is a more flexible approach than messing with the .htaccess file.

URL rewrite/redirect through FTP-access in ASP4.0 / IIS8.0?

I am to redirect some URLs from an old site to a new site on a different domain name. Normally I would do this editing/uploading a .htaccess file on Apache servers. Piece of cake.
Now, I've been given FTP-access to the old server.
However, its a ASP4.0 / IIS8.0 server and I cannot use the .htaccess-method it seems.
My questions therefore: is there a solution to this through only FTP-access? Should I upload/edit a specific file? I have never worked with ASP-servers.
Help is much appreciated, thanks.

.htaccess redirects - I am completely lost

I am trying to create some redirects using htaccess but I am quite a bit overwhelmed with it all. So here it goes.
The NEW domain is hosted on my hosting account but there is no site built. I just want to use the domain for "easier" branding. Here is what I am trying to achieve.
I want people who go to my NewDomain.com be redirected to an external site: blog.OldDomain.com/podcast/
I also want to create redirects to upcoming new posts. For example, I want to send people to NewDomain.com/1 and have them redirected to blog.OldDomain.com/episode1. Then NewDomain.com/2 would redirect to blog.OldDomain.com/episode2, etc.
I hope someone can help me with this!
Thanks!
Ok nevermind, I found the solution. Simply created
Redirect 301 /index.html http://olddomain. com/podcast/
and I will add new lines as I create new pages ;)

Resources