trying to redirect a www domain to a non www i found the following article which work great for a single domain (http://egeek.dk/redirect-www-to-non-www-iis/) but my main problem is I am using orchard and want to do this for multiple tenant/domian name. basically I want any domain that is pointing to the server that has a www. to foward to http://domiananame.extension
We have a little module that does this so I have never tried using this module but you could try it out, may do what you are looking for...
https://gallery.orchardproject.net/List/Modules/Orchard.Module.CloudConstruct.BrowserDetection
Related
I need to redirect several URLs to a new site that will have pages that replace the old sites. I don't care if the URL is masked or not. I just need the URL's to go to the new pages on the new combined site.
For example:
Oldsite.com redirects to NewSite.com/Sub/NewPage
Oldsite2.com redirects to NewSite.com/Sub/NewPage2
Oldsite3.com redirects to NewSite.com/Sub/NewPage3
and so on.
I've tried domain forwarding on the DNS level, but that isn't working (likely because of the subdirectories).
Problem is the New site was developed in Webflow and I don't have access to implement custom code for redirects.
My thought is to host a separate site to act as a hub that handles all the custom redirects to the New webflow site.
Any help or insight would be greatly appreciated.
Your scenario here isn't entirely clear on the types of redirections you're attempting to do.
If you're trying to redirect all paths from the old site to a specific destination page, like this...
oldsite.com/* ➜ newsite.com/sub/newpage
...many modern DNS providers support that.
If yours does not, you can switch your nameservers to Cloudflare DNS free edition, and you'll have the ability to define up to 3 page rules that support wildcard redirections like this.
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
I plan to run multiple sites on that server.
I looked arround a bit but only found rather cryptic stuff i can't work with.
So basically all projects reside in their subfolder in /var/www/. Multiple sites go with multiple domains, so what I want to accomplish is this:
http://example.com goes to my xx.xx.xx (serverip) and loads the site in /var/www/example/publicdir/index.php
http://something.else maps to /var/www/something/publicdir/index.php
Is it something that needs to be done in the apache on the server via virtualhosts? I'm completely clueless
Oh yeah I have an extra condition, I dont want 301 Redirects
I hope you can get through my babbling, my head feels like jelly since I'm trying to get it done for a few hours
Look into VirtualHost config. You don't need any mod_rewrite stuff. You can setup multiple domains in same Apache config with one VirtualHost section for each domain.
Basically what you want is to have different Document root for different domains. The example here will help you http://httpd.apache.org/docs/2.2/vhosts/mass.html#xtra-conf
I have two domains on a VPS server, the primary "domain1.net" and the secondary "domain2.com". The website I have currently set up for domain2.com resides at domain1.net/subd1/subd2. I'm trying to create a rewrite rule for my .htaccess file so that whenever someone visits the site "domain2.com", "domain2.com/index.php", it grabs the page from "domain1.net/subd1/subd2", "domain1.net/subd1/subd2/index.php". I would like to do this while keeping "domain2.com" intact in the web address, instead of moreover redirecting it, and have all images/links appear from domain2.com.
From my understanding, it seems .htaccess's rewrite rule would be able to do such a thing, I just haven't figured out how the syntax would work. However, if there's a superior alternate method, I wouldn't be opposed to hearing it.
I appreciate anyone's help on this issue.
I using Symfony2.
What would be the best practice to get a variable from URL. I am using subdomain to get the city.
Ex: paris.website.com
how do I get Paris as variable.
I believe I need to play with Kernel and htaccess, but I haven't figured out how.
Thanks if you can put me on right tracks about that.
Cheers,
Pierre.
You should read the documentation of Symfony. One of the basis components of Symfony is the Routing that provides exactly what you need :
www.mysite.com/paris/
Using the subdomain is not the solution, but you can play with .htaccess to rewrite subdomain paris.mysite.com to www.mysite.com/paris (if web server allows it) after having configured your route in Symfony.