The forum of the forums
Would you like to react to this message? Create an account in a few clicks or log in to continue.

Change HTML's page URL

5 posters

Go down

Solved Change HTML's page URL

Post by J0k3R^ 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^
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^ June 1st 2014, 7:24 pm

Bump?
J0k3R^
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 June 2nd 2014, 8:49 am

Hello,

I'm not 100% this works; Click here

Kind Regards,
Angela
AngelaHolmes
AngelaHolmes
Forumember

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

https://help.forumotion.com

Back to top Go down

Solved Re: Change HTML's page URL

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

bump?
J0k3R^
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 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
Ange Tuteur
Forumaster

Male Posts : 13246
Reputation : 3000
Language : English & 日本語
Location : Pennsylvania

https://fmdesign.forumotion.com

Back to top Go down

Solved Re: Change HTML's page URL

Post by J0k3R^ 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^
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^ June 10th 2014, 4:24 pm

bump
J0k3R^
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 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
SSYT
Forumember

Male Posts : 77
Reputation : 15
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^ June 10th 2014, 7:03 pm

Thanks for ur reply Inferno.
what should i replace "w" with?
J0k3R^
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 June 10th 2014, 7:32 pm

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

Male Posts : 77
Reputation : 15
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^ 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/store it says the following error:

Change HTML's page URL T4XcG6u
J0k3R^
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 June 10th 2014, 8:01 pm

Is not posibe to rewrite a forumotion links...
SSYT
SSYT
Forumember

Male Posts : 77
Reputation : 15
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 June 10th 2014, 10:27 pm

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

Male Posts : 13246
Reputation : 3000
Language : English & 日本語
Location : Pennsylvania

https://fmdesign.forumotion.com

Back to top Go down

Solved Re: Change HTML's page URL

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

okey, that was my question.
solved, plz lock Smile
J0k3R^
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 June 11th 2014, 6:57 am

Solved
Jophy
Jophy
ForumGuru

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

Back to top Go down

Back to top

- Similar topics

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