Forwarding from domain names without using frames - html

I own a domain name e.g. www.mydomain.com
I also own a web server e.g. www.myserver.com
After navigating to my web server via www.myserver.com clicking on links to different pages within my servers file structure will result in a change in URL...
For example
Clicking on a link to main.html will result in www.myserver.com/main.html
However if I use framed forwarding from my domain name www.mydomain.com and perform the same action the url will not change since only the internal frame containing myserver's content will be changed...
this I know is a fundemental problem with using frames, however there must be some way of maintianing a full url with the domain name i.e.
www.mydomain.com/main.html
I have managed to achieve this with frames by making the links use
href="www.mydomain.com/main.html"
instead of
href="main.html"
But this seems to be a bit of a dirty method in my opinion. Any ideas?
This is probably a very stupid question.

Why use "framed forwarding" It would seem what you are really wanting is the content / data from www.mywebserver.com to show up under www.mydomainname.com .
Simply add the domain to your webserver's configuration and let it serve the content. No frames necessary.

Related

Attachment of external content - forcing although X-Frame-Option=SAMEORIGIN

I read more in the Internet, but I didn't managed to find solution to this problem:
Is it possible to attach some external content in case of sending X-Frame-Option=SAMEORIGIN by server ?
I know that <iframe> can't be used, however maybe there exists some another way.
Thanks in advance
No, it's not possible to show another page's contents within your website if they are setting the HTTP header X-Frame-Options: SAMEORIGIN. That header says that the page can only be embedded on pages on the same domain name.
However, if you are running your own server-side application (i.e. using PHP, Node.js, etc), you can scrape the website on your server, and then display whatever info you needed from the other site that way. It will be more work this way, and you probably won't be able to perfectly replicate how everything appeared on the source site, but it's the only route you've got. I suggest googling "scraping" + the name of your server-side language/environment to learn how to do this.

How to mask a URL via HTML or .htaccess

I am setting up a website that I want no one to know the URL for. For example, I send them a link that actually goes to the page, but the URL in the bar at the top has a completely different URL that I don't own. I'm not sure if this can be done in PHP, HTML, or the .htaccess file.
This is not possible, unless
you control the systems of the visitors (then you could, for example, change their DNS servers), or
you find and exploit a bug in the browser/system.
You can make a link anchor text look like it leads to a specific domain not under your control, but the real URL will be used in any case. Example: http://wikipedia.org/.

How can I hide the full url of my website?

When I upload my website files to my server and goto my website, i see the index.html at the url bar of the browser. How can I hide this?
http://bakpinar.com/about/about-us.html
I would like it to look like in this example;
http://www.royaltyline.com
as you can see, you only see the website address in the url bar of the browser. And when you click to another page, it doesnt show the .php, .asp or .html extension, just shows the folder name.
To hide the extension shown in the address bar, you have two options.
If you control the server, you can define rules that rewrite the URL based on the one the user is trying to get to. In PHP you can use the .htaccess file to define mod_rewrite rules. For similar features to .htaccess you can install the application request routing module in IIS 7 and above. In IIS (Windows) you can set up default pages that come up when users go to particular sites.
You can also make that all of your pages are accessed through the same page using AJAX, or put all the content on the same page and hide it using CSS and display it with CSS and/or JS.
This is a very high level answer, because the specifics vary greatly from situation to situation.
An easy way to do this, in case someone is still looking, is to use a full-screen iFrame. No matter where on the page your users are, they will always only see the main url. This used to be very popular back in the day, but it was a terrible practise in terms of usability.
<html><head>the stuff</head><body>
<iframe src="http://bakpinar.com/about/about-us.html" width=100% height=100%></iframe></body></html>
Write that into the index.html file at http://www.royaltyline.com
Yes, you can do by javascript.
<script>
window.history.replaceState('','','/');
</script>
It's not actually a folder name. It's rewritten URL.
To do such things you should redirect all requests to one file (index.php for example), then parse URL and basing on its parts, show particular file.
To redirect everything to index.php, use mod_rewrite module of Apache + .htaccess file.
To choose specific file you can implement one of several approaches. It's usually called routing in design patterns.
Completely other approach would be to use AJAX for reloading content. But it's not the way it was made on the website you gave as example.
In general there is a lot of information about routing urls in PHP on the web. Just do some research.
You are effectively looking to rewrite URLs. If your web server is Apache you will be able to use the rewriting module (mod_rewrite) to direct requests to http://bakpinar.com/about/ to http://bakpinar.com/about/about-us.html
If you are not running Apache, most web servers will serve index.html as the default page when requesting a directory, so renaming
about-us.html
to
index.html
and changing incoming links to
/about/about-us.html
to simply
/about/
Will give you the same results.

Hide the file name in the URL

what is the best method of hiding the file name in the URL from a developers side (who has no control over the server), for example if the site is www.123.co.za/contact.htm - i wan the user to only see www.123.co.za. an example of such can be seen here http://www.groupon.co.za
ways i know of is using one page and dynamically loading page content using ajax
the other is frames
(server options like mod_rewrite i cant use as i dnt have access to or control over the server)
They are using index pages. That means they have a page such as index.html, index.php, or index.aspx, etc. All you have to do is create a directory (for example, 'contact') and put a file named 'index.html' within that directory. Then you can view www.123.co.za/contact/index.html as www.123.co.za/contact. Note that your allowable index page names may vary. If index.* doesn't work for you, contact the host and ask (sometimes it's default.*).
The catch to this method is that your page is now viewable by at lest three URLS (www.123.co.za/contact, www.123.co.za/contact/, www.123.co.za/contact/index.html). This can hurt your site in search engines for you may get penalized for "duplicate" content. You could solve this issue with mod_rewrite but seeing as you can't use that, you can't prevent the aforementioned scenario.

Unsure about website address structure

In my websites normally I use Ajax, so the address is always something like
www.xxx.com for all pages.
But now I read and search in google and I cant understand how is made this type of site:
https://welshare.com/login
https://welshare.com/signup
If I change the address bar to login.php or asp or html the page gives an error.
So my question is, how I can make something like that? is it htaccess?
what is the login? a new page? a module?
If you are using apache as your server, you'll want to look into mod_rewrite. IIS also has an extension for this called URL rewrite.
Edit
To elaborate on how it works: Once you have your rules set up, it will look at the requested URL (say, mysite.com/test) and then on the server side, actually send a request to mysite.com/index.php?page=test. Whatever the output of the request is will be sent back to the user's browser and they will have no idea that that's actually the page that was requested.
mod_rewrite is the way to go. For a very easy to use tutorial click the link.
What is does in a nutshell is take a URL like http://www.example.com/index.asp?page=login and with the right parameters, transforms it into http://www.example.com/login