Forum moderator: bigblog  
uCoz Community » For Webmasters » Custom Solutions » How to Make Custom Path Redirection for Various Modules (A 7-step short tutorial.)
How to Make Custom Path Redirection for Various Modules
CoffeeCone
Posts: 687
Reputation: 41

Message # 1 | 8:04 AM
Have you ever had that certain instance where you want http://your-ucoz-site.com/stuff to also be accessible via http://your-ucoz-site.com/onlinegames? Well good news, here's a tutorial that will help you add redirections to virtually any URL you want. Be it inside your website or to external links, e.g.; http://your-ucoz-site.com/facebook will redirect users to http://www.facebook.com/your-ucoz-site-page.

Things you'll need:
- Any plain text editor. (You can't use Microsoft Word or any rich text editor.)
- Access to your uCoz website's File Manager.

Things to do:
1. Open up your text editor (e.g. notepad) and type or copy the code below.

Quote
<html>
<head><title>Redirecting...</title></head>
<meta http-equiv="refresh" content="1;url=http://your-new-url/">
<body>
<p>Please wait while you are redirected...</p>
<script>window.location.replace('http://your-new-url/');</script>
</body>
</html>

On the code above, replace http://your-new-url/ with the one you want.

2. Save your file to index.html.

3. On your website's File Manager, create a new folder name it whatever you want, e.g.; onlinegames.

4. Inside your newly created folder, upload your index.html file.

5. Make sure that the file is named index.html.

6. Test out your new url redirection by visiting http://your-ucoz-site/yournewfolder.

7. If you followed everything correctly that should work and you will be redirected to the URL you specified.

This concludes this simple set of instructions on how to set up redirection on your uCoz website.

Conclusion:
You probably already knew how the above tutorial would work. You might just have overlooked it. smile

Demo Video
For those of you having trouble following the instructions above, here's a quick video demo on how to do it.


"Friends don't let friends use Internet Explorer 6." - Microsoft || Join the cause. Help your friends.


Post edited by shadowslash - Wednesday, 2011-02-23, 6:21 AM
Bloodyboy450
Posts: 80
Reputation: 1

Message # 16 | 8:54 PM
Sunny,

I am using his code, he created two different ones. The one above lets you type in a customized URL address, then it redirects you to the old one. I am trying to make it so it stays as the customized address, instead of it redirecting you to the old one after typing it in. Sorry for all this, just want to know how to do it. I know its possible, I've seen many sites do it already.

If you don't know how that's fine I don't want to be such a bother.

Page I got code from: http://forum.ucoz.com/forum/38-12531-1

Added (2012-04-18, 2:54 PM)
---------------------------------------------
Guess its not possible with Ucoz... Or?

Paradox
Old Guard
Posts: 3284
Reputation: 145

Message # 17 | 7:41 AM
Bloodyboy450, you can't stop a pages URL from displaying in a browser no matter how hard you try. Web browsers are programmed to display the active pages URL by default. There is no way to change this as the scripting for it is built-in to the computer itself.

It's not just impossible with uCoz, it's simply impossible.

Jack of all trades in development, design, strategy.
Working as a Support Engineer.
Been here for 13 years and counting.
Bloodyboy450
Posts: 80
Reputation: 1

Message # 18 | 11:14 AM
Thanks for the reply Paradox,

Though that is not my goal... If you read my earlier posts from this same topic on the last page, I wish to use a customized URL, as the script above is doing, read my other posts they explain a bit more.
Paradox
Old Guard
Posts: 3284
Reputation: 145

Message # 19 | 7:20 AM
Bloodyboy450, sorry about that, I was following your dicussion earlier however hadn't noticed you were using the other version of the code shadowslash had posted. It is possible with uCoz as the file setup for every internet site is predominantly the same. If you followed the code provided it should have worked perfectly, however I will recheck the original code later today when i have more time.
Jack of all trades in development, design, strategy.
Working as a Support Engineer.
Been here for 13 years and counting.
Bloodyboy450
Posts: 80
Reputation: 1

Message # 20 | 8:26 PM
Thanks Paradox,

I used the code, and everything worked perfectly, though the only problem is that after you go to the customized URL, and go to another page, the URL does not seem to change. Thanks for checking it when you have time.

Added (2012-04-23, 2:26 PM)
---------------------------------------------
Bump.

Paradox
Old Guard
Posts: 3284
Reputation: 145

Message # 21 | 8:32 AM
Bloodyboy450, sorry about the late reply. As to your problem, I believe all the links you are clicking on are simply opening in the frame because they haven't been specified to open as a entirely new active page to load into the browser. It's a little confusing but all the links you are clicking are simple redirecting inside the frame you have originally created.

As to a way around it you're either going to have to mark all your links as <a ... target="_top"> or alternatively you could use a script. I can give you a simple script which will do the job by adding target="_top" to all your links however I need to know whether you are already using jQuery or not on your site?

Jack of all trades in development, design, strategy.
Working as a Support Engineer.
Been here for 13 years and counting.
Bloodyboy450
Posts: 80
Reputation: 1

Message # 22 | 2:26 AM
No worries, I know you're busy.

And, ah... That makes sense. I would love to use your script, and I am currently using jQuery-1.6.1.js.

Added (2012-04-28, 8:26 PM)
---------------------------------------------
Bump.

Plantillasw
Posts: 29
Reputation: 0

Message # 23 | 0:06 AM
Yes, the code used to shadowslash is effective, I like ....
Hello, I'm a graphic designer emr dustin, I am programmer and diseñor addition of web pages, uCoz chose because of its advantages.
Bloodyboy450
Posts: 80
Reputation: 1

Message # 24 | 8:25 PM
Bump.
Paradox
Old Guard
Posts: 3284
Reputation: 145

Message # 25 | 2:51 PM
Bloodyboy450, my apologies about the late reply. As to the script you were after as far as I am aware this should work. smile If it doesn't I will take a second look at the problem however this should do it. wink

Code
<script type="text/javascript">
$(document).ready(function(){
        $("a").attr("target","_top");
});
</script>


'NB: jQuery will need to be enabled for this to work.
'NB2: This script needs to be pasted in the page opened in the frame. Not the page that has the frame.

Jack of all trades in development, design, strategy.
Working as a Support Engineer.
Been here for 13 years and counting.
Bloodyboy450
Posts: 80
Reputation: 1

Message # 26 | 3:14 PM
Paradox, thanks so much, it works! W00t. Working perfectly. =]!
Tony
Posts: 16
Reputation: 0

Message # 27 | 11:03 AM
CoffeeCone, is it a 301 Redirect? I need 301...

"Things to do:
1. Open up your text editor (e.g. notepad) and type or copy the code below.

Quote
<html>
<head><title>Redirecting...</title></head>
<meta http-equiv="refresh" content="1;url=http://your-new-url/">
<body>
<p>Please wait while you are redirected...</p>
<script>window.location.replace('http://your-new-url/');</script>
</body>
</html>

On the code above, replace http://your-new-url/ with the one you want.
2. Save your file to index.html. .........

"
Post edited by Tony - Tuesday, 2012-06-19, 11:04 AM
CoffeeCone
Posts: 687
Reputation: 41

Message # 28 | 11:11 AM
Quote (Tony)
CoffeeCone, is it a 301 Redirect? I need 301...

Unfortunately, no. You can never do a 301 redirect via JavaScript. It's only possible if you can access the .HTACCESS file or have a PHP implementation on that page. sad

"Friends don't let friends use Internet Explorer 6." - Microsoft || Join the cause. Help your friends.


Tony
Posts: 16
Reputation: 0

Message # 29 | 11:18 AM
But as far as I know, in Ucoz you cannot access the .HTACCESS file. Is PHP implementation possible and how?
CoffeeCone
Posts: 687
Reputation: 41

Message # 30 | 11:46 AM
I think PHP is supported by uCoz as an add-on thing. Meaning you have to pay for it. I'm not too sure about the particulars of the PHP system on uCoz as well as the price but as far as I know, they have that here.
"Friends don't let friends use Internet Explorer 6." - Microsoft || Join the cause. Help your friends.


uCoz Community » For Webmasters » Custom Solutions » How to Make Custom Path Redirection for Various Modules (A 7-step short tutorial.)
Search: