Create a link that can later be customized to different URL - html

I would like to create a link that I can customize later.
For example,
I create a href link in the footer of the website I developed for my client with the URL that forwards to my current Web design website.
In the future, if I have to change my Web design website URL I will just customize that footer link forward destination to another one without having to access the CPanel of my client's website.
Please tell me how is it possible to do. Is this possible to with any link shortener services?

The usual way to do this is to set up a redirect from your old site to your new, with a 301 status code. This is easily done with a simple configuration directive in your web server config.

I doubt if there is any link generator service that let you change the redirection link after generated.
If you will be able to access your previous url, link it with redirection page that will redirect client into your current url.
Or get a free domain that only works as redirection link.

Related

How can I make it so HTML links can go to different websites?

I'm making a website using glitch.com and am trying to redirect the user to an external website. Whenever I click on the links, it just says https://utili.glitch.me/link rather than the website. How can I make it so it can send the user to an external website?
Many thanks
You need to add http://, https:// or // before url to redirect your link to another page, Check updated code below
Google
view our website
try this code

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.

How to redirect old website pages to new website which has same domain but new html page names?

I'm working on a website which has had all it's page names changed from the older version however it still has the same domain name. All I want to do is re-direct the page links on google searches to the domain and/or redirect the pages to their new page named versions.
I know this can be done with a .htaccess file. But I'm not sure how as I have tried and it's not working.
To tell google that pages have changed their name you should use 301 redirects.
Here is a nice documentation about howto do those: http://httpd.apache.org/docs/current/mod/mod_alias.html#redirectpermanent
Using mod_alias you can also define regex patterns, like for example /(.*)_old.html has to go to /$1_new.html or things like this, by using RedirectMatch.
Make sure that you use permanent redirects, because google pays attention to if you use permanent (301) or just temporary (302) redirects.

ensure embed code (iframe) is only used on customer web sites

I have a service and would like clients to be able to place this service on their website. I am looking at doing this by using an iframe. I will provide the code and they can just copy and paste the code to show the functionality. Each client will be discovered by the query string.
There is a concern that anyone can look at the source of the website, copy the iframe and add it to their own website therefore using the service and charging the original client. I obviously want to stop this.
Ideally, I would like to verify that the website that is using the iframe is linked to the client who registered to use the service. Is this possible at all? I know there are issues with cross domain security.
If it isn't possible, I guess I would need to create a widget instead.
For each client, have a whitelist of web sites that can embed the iframe. Then check the 'referer' header against that list whenever the page inside the iframe is loaded.
Or if http headers prove to be unreliable try using javascript, via parent.document.location.href

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