Change HTML's page URL
5 posters
Page 1 of 1
Change HTML's page URL
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
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
Re: Change HTML's page URL
Hello Joker,
You can use history.pushstate to change the current path without reloading the page. Just place the following in your HTML page :
You can modify it as needed, just focus on :
title : the title of the page (optional)
pathname : the current URL path
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
Re: Change HTML's page URL
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.."
Re: Change HTML's page URL
- 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
Re: Change HTML's page URL
with nothingJ0k3R^ wrote:Thanks for ur reply Inferno.
what should i replace "w" with?
Re: Change HTML's page URL
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:
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:
Re: Change HTML's page URL
It is only to simply "spoof" the pathname, you cannot remove h1- from the real path.
Jophy- ForumGuru
- Posts : 17924
Reputation : 836
Language : English
Location : Somewhere
Similar topics
» User Cannot Scroll Page + Sudden Page Format Change
» HTMLs in members profile
» Can I change page to go to after Log-in?
» How can i change 404 Page
» page name change
» HTMLs in members profile
» Can I change page to go to after Log-in?
» How can i change 404 Page
» page name change
Page 1 of 1
Permissions in this forum:
You cannot reply to topics in this forum