How to redirect 404 - redirect

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.

Related

Creating a page on CMS

For example:
I create a page on Joomla or Wordpress and then save it.
I create an entry in the menu that points to the new page.
When I select the new entry in the menu the page opens on the browser.
The URL that appears points to a file that doesn't exist on the server.
What is the mechanism that is used by a CMS like Joomla or wordpress to accomplish this?
This is typically done with a URL rewriting module that runs on the web server (mod_rewrite for Apache or URL Rewrite for IIS on Windows). It will rewrite a request URL like /blog/article-title to something like /index.php/blog/article-title or /index.php?q=blog/article-title before the website code even sees the request. Then, the code in index.php extracts the rest of the path and determines which content to serve based on that.
For Wordpress, see http://codex.wordpress.org/Using_Permalinks for some info about how the rewrites are set up.

Creating a redirect in IIS6

I need to create a redirect from www.domain.com/page to another page in a different domain. I need the first (referring) url to have no extension (meaning no .html or .asp).
I know how to do it in Apache, but have no clue how to work with iis6.
Is there any simple way of doing this?
Here is an easy solution:
Create a folder for your website www.domain.com and then another sub folder for "page".
Create a website in IIS manager for www.domain.com
Expand that website, and then right click on your "page" folder, choose properties.
On the directory tab, choose the option: A redirection to a URL put the full domain of the target location. You may also want to examine the check boxes below it if that fits your needs.
Another option that you could do outside of IIS is setup your website, and take advantage of the "default document". if you add an index.html file into your website at http://www.domain.com/page , the default document will be called automatically without referencing the index.html in your path and you can do a javascript redirect.
<script>
window.location='http://www.someothersite.com/page.html'
</script>
This may be easier when dealing with a large number of pages.

Where are subdomains ("shortcuts") defined in TYPO3?

On a corporate website managed with TYPO3 there are shortcuts defined which lead to a page on the site.
Example:
Corporate website is www.acompany.com
Then there is a site www.acompany.com/coolproduct which is redirecting the user to www.acompany.com/products/productgroup3/product25.htm for example.
Where in TYPO3 can such "shortcut" links be defined?
Most probably some page in the page tree has set type to: Shortcut which causes that it points some other page or resource, it's also possible that is set as Link to External URL and there is full URL given.
Check the page tree in the backend and find your coolproduct page in it. Then check the site's properties and change if required to other value/type.
It's also possible that this URL is generated by some plugin or TypoScript, but in this case you'll need to investigate it yourself.
Simplest way to find these kinds of things is actually using the search engine in the TYPO3 backend. You will find it in the upper right corner.
If this fails, what I do is install PhpMyAdmin from the extension repository. Once you have PhpMyAdmin you can use it's search functionality to find anything in the database using a search query of: '%coolproduct%' and selecting all tables. In the results look for the 'pid' field. It tells you on which page in TYPO3 the found item is located.
Does the page use the extension realURL? If so, there might be realURL redirects defined.
Have a look at page -> info -> RealUrl -> Redirects
Maybe you the user has defined this link redirection in many pages, you can search for it in the database exactly in the tt_content table.
You can set shortcut for your domain to any page of your site, so when user enter only your domain name in url then it redirects to page which you set in shortcut.
For that edit your domain and set shortcut to any page of your page tree.

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>

How do I get sun webserver to redirect from

I have Sun webserver iws6 (iplanet 6) proxying my bea cluster.
My cluster is under /portal/yadda.
I want anyone who goes to
http://the.domain.com/
to be quickly redirected to
http://the.domain.com/portal/
I have and index.html that does a post and redirect, but the user sometimes sees it.
Does anyone have a better way?
Aaron
I have tried the 3 replies below. None of them worked for me. Back to the drawing board.
A
Does this help?
http://docs.sun.com/source/816-5691-10/essearch.htm#25618
To map a URL, perform the following steps:
Open the Class Manager and select the server instance from the drop-down list.
Choose the Content Mgmt tab.
Click the Additional Document Directories link.
The web server displays the Additional Document Directories page.
(Optional) Add another directory by entering one of the following.
URL prefix.
For example: plans.
Absolute physical path of the directory you want the URL mapped to.
For example:
C:/iPlanet/Servers/docs/marketing/plans
Click OK.
Click Apply.
Edit one of the current additional directories listed by selecting one of the following:
Edit
Remove
If editing, select edit next to the listed directory you wish to change.
Enter a new prefix using ASCII format.
(Optional) Select a style in the Apply Style drop-down list if you want to apply a style to the directory:
For more information about styles, see Applying Configuration Styles.
Click OK to add the new document directory.
Click Apply.
Choose Apply Changes to hard start /restart your server.
You could also just add the below line in the .htaccess file
Redirect permanent /oldpage.html http://www.example.com/newpage.html
You should be able to configure the webserver to do a header redirect (301 or 302 depending on your situation) so it redirects without ever loading an HTML page. This can be done in PHP as well:
<?php
header("Location: http://www.example.com/"); /* Redirect browser */
/* Make sure that code below does not get executed when we redirect. */
exit;
?>
If you don't want to modify your server configuration.
If your server uses the .htaccess file, insert a line similar to the following:
Redirect 301 /oldpage.html http://www.example.com/newpage.html
-Adam