The forum of the forums
Welcome to the Official Support Forum of Forumotion!

To take full advantage of everything offered by our forum, please log in if you are already a member, or join our community if you've not yet.



Create a free forum like this one.

Change HTML's page URL

View previous topic View next topic Go down

Solved Change HTML's page URL

Post by J0k3R^ on May 31st 2014, 8:40 am

Hi, i want to make a question.
i think this is not possible but let me ask:
is it possible to change a html's page url ? from /h1-page to a custom url for example /custom

J0k3R^
Forumember

Male Posts : 742
Reputation : 28
Language : Greek > English > Russian > Spanish
Location : C:\>r00t

http://fmplanet.forumgreek.com

Back to top Go down

Solved Re: Change HTML's page URL

Post by J0k3R^ on June 1st 2014, 7:24 pm

Bump?

J0k3R^
Forumember

Male Posts : 742
Reputation : 28
Language : Greek > English > Russian > Spanish
Location : C:\>r00t

http://fmplanet.forumgreek.com

Back to top Go down

Solved Re: Change HTML's page URL

Post by AngelaHolmes on June 2nd 2014, 8:49 am

Hello,

I'm not 100% this works;Click here

Kind Regards,
Angela

AngelaHolmes
Forumember

Male Posts : 203
Reputation : 8
Language : English
Location : England

http://Help.Forumotion.com

Back to top Go down

Solved Re: Change HTML's page URL

Post by J0k3R^ on June 8th 2014, 6:02 pm

bump?

J0k3R^
Forumember

Male Posts : 742
Reputation : 28
Language : Greek > English > Russian > Spanish
Location : C:\>r00t

http://fmplanet.forumgreek.com

Back to top Go down

Solved Re: Change HTML's page URL

Post by Ange Tuteur on June 9th 2014, 6:56 am

Hello Joker,

You can use history.pushstate to change the current path without reloading the page. Just place the following in your HTML page :
Code:
<script>
 history.pushState({page : "html"}, "title", "pathname");
</script>

You can modify it as needed, just focus on :
title : the title of the page (optional)
pathname : the current URL path

Ange Tuteur
Forumaster

Male Posts : 13021
Reputation : 2683
Language : EN10, FR5
Location : Pennsylvania

http://fmdesign.forumotion.com

Back to top Go down

Solved Re: Change HTML's page URL

Post by J0k3R^ on June 9th 2014, 8:42 am

Ange, this is working but if i try on address bar of my browser fmplanet.forumgreek.com/custom it says "page doesnt exist, press to return to homepage.."

J0k3R^
Forumember

Male Posts : 742
Reputation : 28
Language : Greek > English > Russian > Spanish
Location : C:\>r00t

http://fmplanet.forumgreek.com

Back to top Go down

Solved Re: Change HTML's page URL

Post by J0k3R^ on June 10th 2014, 4:24 pm

bump

J0k3R^
Forumember

Male Posts : 742
Reputation : 28
Language : Greek > English > Russian > Spanish
Location : C:\>r00t

http://fmplanet.forumgreek.com

Back to top Go down

Solved Re: Change HTML's page URL

Post by SSYT on June 10th 2014, 6:55 pm

Code:
$(function() {
 // New IPB Link for users
 if(/\/h1-(\w*)/.test(window.location.pathname)) {
 var a = "custom page h2";
 history.pushState(null, "", encodeURIComponent(a));
 }
});

var a = link for new page
\/h1- = /hidpage-auto get name
(\w*) = auto get page-name

try my code Smile

SSYT
Forumember

Male Posts : 37
Reputation : 2
Language : RO-10, EN-3, FR-1
Location : Romania

http://help.forumgratuit.ro/forum

Back to top Go down

Solved Re: Change HTML's page URL

Post by J0k3R^ on June 10th 2014, 7:03 pm

Thanks for ur reply Inferno.
what should i replace "w" with?

J0k3R^
Forumember

Male Posts : 742
Reputation : 28
Language : Greek > English > Russian > Spanish
Location : C:\>r00t

http://fmplanet.forumgreek.com

Back to top Go down

Solved Re: Change HTML's page URL

Post by SSYT on June 10th 2014, 7:32 pm

@J0k3R^ wrote:Thanks for ur reply Inferno.
what should i replace "w" with?
with nothing

SSYT
Forumember

Male Posts : 37
Reputation : 2
Language : RO-10, EN-3, FR-1
Location : Romania

http://help.forumgratuit.ro/forum

Back to top Go down

Solved Re: Change HTML's page URL

Post by J0k3R^ on June 10th 2014, 7:40 pm

i tried and it just changes the current url.
as i told to Ange,if i try to write on address bar of my browser fmplanet.forumgreek.com/storeit says the following error:


J0k3R^
Forumember

Male Posts : 742
Reputation : 28
Language : Greek > English > Russian > Spanish
Location : C:\>r00t

http://fmplanet.forumgreek.com

Back to top Go down

Solved Re: Change HTML's page URL

Post by SSYT on June 10th 2014, 8:01 pm

Is not posibe to rewrite a forumotion links...

SSYT
Forumember

Male Posts : 37
Reputation : 2
Language : RO-10, EN-3, FR-1
Location : Romania

http://help.forumgratuit.ro/forum

Back to top Go down

Solved Re: Change HTML's page URL

Post by Ange Tuteur on June 10th 2014, 10:27 pm

It is only to simply "spoof" the pathname, you cannot remove h1- from the real path.

Ange Tuteur
Forumaster

Male Posts : 13021
Reputation : 2683
Language : EN10, FR5
Location : Pennsylvania

http://fmdesign.forumotion.com

Back to top Go down

Solved Re: Change HTML's page URL

Post by J0k3R^ on June 11th 2014, 6:44 am

okey, that was my question.
solved, plz lock Smile

J0k3R^
Forumember

Male Posts : 742
Reputation : 28
Language : Greek > English > Russian > Spanish
Location : C:\>r00t

http://fmplanet.forumgreek.com

Back to top Go down

Solved Re: Change HTML's page URL

Post by Jophy on June 11th 2014, 6:57 am

Solved

Jophy
ForumGuru

Male Posts : 17924
Reputation : 835
Language : English
Location : Somewhere

Back to top Go down

View previous topic View next topic Back to top


 
Permissions in this forum:
You cannot reply to topics in this forum