ColdFusion route redirects - redirect

Is there a way using ColdFusion to have a one page that can route url redirects? I have a bunch of one off page redirects and it is really weighting down my Git commands.
So Like:
abc/index
test/index
redirect/index
etc...
So I'm trying to figure out a way to move these all to one app that can route them to the correct redirect. Doing this on the server is not an option for me as our server admin has a lockdown on access.

the best is to have URL rewrites at the server level.
However, you can you use onRequestStart function in your Application.cfc and match the page being called and redirect accordingly.
Basically, have some logic added in the onRequestStart according to your needs.

Related

New website on https, do I need to set up redirect?

We have an e-commerce website with in 4 languages running on ourbrand.com, ourbrand.de, ourbrand.fr etc. Currently 3 of those are running on http and the last one we are just ready to launch will be on https. I am trying to figure out if and how I need to set up htaccess redirect.
There is no history of running this new website on http (so no need to redirect existing http traffic), but I am sure that some people will type ourbrand.it or www.ourbrand.it directly to their browser's address bar. As far as I know, browser will default it to http://ourbrand.it right? So do I need to set up redirect to https? Which one? 301? Thank you.
Yes, because as you said, if your visitors type ourbrand.it the browser will default to http://ourbrand.it
The best thing to do is a 301 (permamant) redirect.
If you want to improve security and avoid that first redirect, your should look into HSTS and HSTS preload.

Adding more than 1000 301 redirects in drupal site

I am using drupal 6.
I worked on the site revamp for one of our clients and we needed to redirect the old site urls to relevant new site urls so that we do not loose the traffic. I have used path redirect module for same and added some of the urls.
The issue is we have more than 1000 urls to be added and there is no specific pattern (as old site was in asp.) so it would be 1 to 1 mapping for redirect. Adding it in url alias table via path redirect module is something which is hitting the site performance and again it is a manual process.
Is there any other better and optimal solution for this scenerio?
http://drupal.org/project/path_redirect_import
This module has import feature out of the box.
I'm interpreting this question as a question of performance (not a question of the ease of populating many redirects). Please correct me if I've misunderstood your question.
Put redirects in .htaccess
If you're using Apache, then your alternative is to put the redirects directly into your .htaccess configurations. There should be a similar configuration option for this for IIS as well.
This still means that you would have to create the 1 to 1 mapping for each redirect you want, but the redirects are not stored in your database so it saves hits to the db.
Advantages to using Path Redirect module
Note that the Path Redirect module can log when a redirect was last accessed. This statistic/tracking can help you remove redirects that are no longer in use in the long run.
There are posts on the Path Redirect issue queue that suggest that 1000 redirects should not be a problem but every setup is different. You will need to perform your own benchmarking to check the performance of your particular site.

Redirect to a specific page on a DNN site with an extensionless URL

I have a page on my DotNetNuke site and I would like to set up a redirect and was wondering the best way to do it. Here is the problem:
I have a page on the site: mydomain.com/dashbaord.aspx. I would like users to be able to type mydomain.com/dashboard OR mydomain.com/Dashboard and it will redirect them to the /dashboard.aspx page.
I have IIS6, so I set up wildcard mapping, and it seemed to work for /dashboard, but not /Dashboard. Also, I am looking for it to literally redirect you so that /dashbaord.aspx shows up in the address bar. In addition, the wildcard mapping broke some other links on the site, so I was looking for an alternative method to accomplish this. Is there a way that I can set this up through IIS? Or any other way?
Thanks in advance for the help.
In IIS, create a virtual directory by right clicking on Sites, and then call it Dashboard. Then set that to redirect to a specific URL, in your case, http://mydomain.com/dashboard.aspx.

How to redirect 404

For example in past my website look like this:
Example: www.mywebsite.com/keyword
Now look like this:
Example: www.mywebsite.com/search.php?q=keyword
How can i redirect people who search for a specific tag to my new link?
From "www.mywebsite.com/keyword" to "www.mywebsite.com/search.php?q=keyword"
I'm not so good with coding so based to my examples can somebody make the code that need to be inserted in htaccess file pls.
This are the examples of links:
OLD: www.mywebsite.com/keyword
NEW: www.mywebsite.com/search.php?q=keyword
That redirecting is called URL Rewriting, and is usually done via a .htaccess file for Apache, or with magic if you're using Lighttpd.
I would take a look at this website, which more or less explains how to do it (assuming you're running Apache): http://www.yourhtmlsource.com/sitemanagement/urlrewriting.html
The specific details depend on the web server being used (IIS, Apache, etc.) but basically you could configure those to redirect to a specific web page and extract the keyword from the original URL and place it in the query string parameter list.
For example, in IIS you would do the following:
Start > Programs > Administrative Tools > Internet Services Manager
Select your web site from the list and right-click to go Properties.
The Custom Errors tab is where you will see a list of HTTP errors.
Select the "404" page and "Edit Properties" to point this to a web page of your choosing.
The last step is where you will plug in your custom code that will handle the redirect.

How do I redirect a domain to a specific "landing page"?

My client has several parked domains. She wants those domains to point to specific pages in her main site. For example:
Let's pretend she has a page on her main site about bedroom redecorating. That page is located at www.mainsite.com/bedrooms/
And let's say she has a parked domain called www.999bedrooms.com/
She wants to redirect that domain to www.mainsite.com/bedrooms/
What's the best way to do this without being penalized by the search engines?
Also, keep in mind that www.mainsite.com/bedrooms is actually a WordPress page, so it's not an actual file on the server, per se.
Thanks!
There are (at least) two ways to do this. One way requires access to some sort of configuration on the server, and the other doesn't. I don't know if you're using the Apache web server, but if you are, you would add mod_alias to your configuration and restart Apache:
a2enmod alias
apache2ctl graceful
Then add this to the VirtualHost section for 999bedrooms.com:
Redirect permanent / http://www.mainsite.com/bedrooms
Then you should be done.
The other way is in an HTML file that you put at http://999bedrooms.com/index.html, put a line like this within the HEAD section:
<meta http-equiv="refresh" content="1; url=http://www.mainsite.com/bedrooms">
This is one of those "Please wait while we redirect you to our main page" sorts of redirections that you see sometimes. Not as nice as the server-based ones, but easier to do.
Hope this helps!
Well there are a couple way. Most likely your web host supports the redirection for you using a 301 Redirect HTTP response. Check out your web host and see if they offer a directory redirection (I know that fastdomain which is my hosting provider does).
Alternatively, if you hosting provide supports PHP you can use the following and place it in a file called index.php in the top level of the domain you wish to redirect.
<?php
header("Location: http://www.mainsite.com/bedrooms/");
exit;
?>
Simply add this line to your header.php file:
<script language="JavaScript">document.location.href = "http://www.mainsite.com/bedrooms";</script>