How to Redirect www.mydomain.net to www.mydomain.net/blog - isapi

I'm using 'Ionics Isapi Rewrite Filter'
I have a web site with a empty root www.mydomain.net and I want, when someone use this url, redirect to my blog www.mydomain.net/blog, how is it possible?.

You don't need a rewriter to do REDIRECT.
You can do that with a default document (like, say, index.html) in the docroot, with a Meta Refresh tag in it.
The content of index.html might be like this:
<META HTTP-EQUIV=Refresh CONTENT="0; URL=blog">
Now if you actually want a REWRITE, that is different.

I'm going to assume that since you're using the Isapi Rewrite filter that you're running on IIS (this answer works for other servers but my instructions are specifically for IIS). You really don't want to use meta refresh and for SEO purposes you want to use a permanent (301) redirect instead.
In IIS you do this by:
Create an empty index.html page
Right click on that page in IIS and open the Properties dialog
On the File tab, select "A redirection to a URL"
Change the "Redirect to" value to http://www.mydomain.net/blog
Check the "A permanent redirection for this resource" checkbox

Here's the solution for ISAPI_Rewrite 3 Lite (which is free):
RewriteBase /
RewriteCond %{HTTP_HOST ^www\.mydomain\.net$ [NC]
RewriteRule ^$ /blog [NC,R=301,L]

Related

Bloomreach: Show neat 404 page in case of non-existing static file

In the sitemap I have arranged that a neat 404 page is shown for non-existing pages. This neat page is not shown when I access a non-existing url in the static folder. How can I achieve this?
On the top level in your sitemap you need to add an any matcher that points to the 404 page.
see also:
https://documentation.bloomreach.com/14/library/concepts/error-pages-and-error-handling/2.-add-a-catch-all-sitemap-item-that-creates-a-dynamic-404-page.html

How to set URl in ADF application....?

I have only one page in adf application, the page is called result.jspx. My requirement is - the url needs to be invoked like http://example.com/ADF_View_Test-ViewController-context-root/faces/result.jspx but when I create ear and deploy it in the weblogic server it is displaying like http://example.com/ADF_View_Test-ViewController-context-root in the url. I am unable to get faces and jspx page. please let me know how to add in the url.
Regards
Santosh
Check the contents of your EAR archive, see if result.jspx is part of it.
If is not, try to recreate deployment profile.
You can always stick an index.html file at the root that does a redirect to where you need it to go.
For example - https://blogs.oracle.com/shay/entry/shorter_url_for_your_adf

Issue with AngularJS/WebAPI application in IIS Website Folder

Here is my issue. I have a Angular/WebAPI project hosted in IIS 8 within a subfolder of the domain. When I access the site with a trailing slash after the folder name, everything works ok. But if I leave off the trailing slash, when Angular adds the '#/' for the route, it breaks.
Example: http://www.domain.com/folder/ becomes http://www.domain.com/folder/#/ <- OK
http://www.domain.com/folder becomes http://www.domain.com/folder#/ < - Breaks
The AngularJS Template I started with does not have this issue. I do not understand what is causing this issue and I don't know how to proceed.
Additional Info on the project
I am using MVC Bundles to minimize the javascript and css
I have WebAPI controllers in the same project
I am using Microsoft OWIN for authentication in the same project
Other than this initial URL issue, the project runs correctly.
I can not reproduce this issue in Visual Studio, but VS doesn't run in a folder.
I can post Angular routes if needed.
This is an issue with how relative pathing works in HTML and not something specific to Angular. This is a result of the original specs for URLs and relative links before there was really even a concept of virtual URLs.
Relative links on your HTML page go from the same base as the HTML "doc" itself. Therefore, if the url is:
http://domain.com/folder/
then, your browser anchors relative URLs at
http://domain.com/folder/[relativePathHere]
The browser assumes that it's looking at the default doc (index.html, home.htm, etc.) in that folder -- what originally was an index of the files in that directory. However, without the trailing slash, the browser thinks "/folder" is actually a file called "folder" that is sitting in the root doc directory for the server (as it has no way of differentiating -- it doesn't care one way or the other whether there is a file extension). So, all relative paths are anchored at
http://domain.com/[relativePathHere]
That's why you're having issues with your relative pathing without the trailing slash. To correct this, you will want to put a rewrite rule into place in IIS. This way, you will be immediately redirected to the version that has a trailing slash before the default HTML file is delivered. This is a very common thing to do (not just for this type of case -- it's also important for SEO so that crawlers don't think that there are two distinct pages).
Check out tip #1 in the following link: http://ruslany.net/2009/04/10-url-rewriting-tips-and-tricks/
Follow the directions for adding the trailing slash, and you should be set.

ImpressPages 4_0_16, 404 errors for all other pages then index.php

i moved my installation from a local place to a new host. the index.php works but other links dont. researched errors for older impresspages versions tell to modify the ip_config.php and change the base url. in the new version there is not such file and the base url gets updated over the admin settings which i did. over phpinfo i could determine that rewrite module is present. there was one idea to add a leadding "/" before index.php?%{QUERY_STRING} [L] into the .htaccess file but this also didnt helped.
My phpinfo: http://pastebin.com/2p0Vay3t
Many thanks for answers.
Nevertheless mod_rewrite module exists it can be turned off for your particular domain. I suggest to contact hosting provider. If you host on your own, add "AllowOverride All" directive to your virtual host.
If you can login to the admin area, go to System menu and click a link that suggests to update links.

.url file displays text instead of going to the website

I have .url files on a server and when I click on them, I see the content of the file instead of having the browser going to the url. As an example, try clicking on this:
http://69.160.61.109/document/116_1.url
The code in the url:
[DEFAULT]
BASEURL=http://www.agriculturemorethanever.ca/
[DOC_gform_ajax_frame_3]
BASEURL=about:blank
ORIGURL=about:blank
[InternetShortcut]
URL=http://www.agriculturemorethanever.ca/
IDList=
IconFile=http://www.agriculturemorethanever.ca/wp-content/uploads/2012/02/favicon1.ico
IconIndex=1
[{000214A0-0000-0000-C000-000000000046}]
Prop3=19,2
I tried with IE9 and FF 15. If I download the file on my desktop, it opens properly.
Thanks for your help.
Luc
".url" files are a Windows specific file format and have no meaning when served from the Internet.
If you want to send a visitor to another website you have several options.
URL Rewrite
If you are running apache with mod_rewrite you can add this to your .htaccess file:
RewriteRule path-to-file http://example.com/ [R=301,L]
Other web servers have similar options.
HTTP Header
You can send an HTTP Location header and 301 response code. The example below uses PHP, but any server programming language has similar functionality.
<?php
header("Location: http://example.com/", true, 301);
exit;
?>
Meta Refresh (not recommended for usability reasons)
This will break the back button on some browsers, so use carefully.
<html>
<head>
<meta http-equiv="refresh" content="0;URL='http://example.com/'">
</head>
</html>
Most of the servers these days are hosted in linux. And servers do not fetch the request and they do not direct/redirect unless webbrowsers are told to do so. In your case the .url file is merely nothing than a file containing few texts. This same file works in windows after downloading because .url file are the shortcuts or hyperlink file which is recognized by windows. Thus windows automatically takes you to the website. Please read more about .url file in the link http://www.fmtz.com/formats/url-file-format/article
If you are trying to have similar kind of behaviour such that clicking on .url file on server takes your to the corresponding web-url then you'll have to implement somekind of javascript tricks or use php server side scripts such that clicking on url file trigger request the browsesr to redirect browser to the link contained in the .url file.
Hope this answer your question.

Resources