해시 (#
)는 서버로 보내지지 않으므로 서버에서 조작 할 수 없습니다.
정말로 제거해야하는 경우 각 페이지에서 JavaScript를 사용해야합니다.
// Wait for the page to load, and call 'removeHash'.
document.addEventListener("DOMContentLoaded", removeHash);
document.addEventListener("Load", removeHash);
function removeHash() {
// If there is no hash, don't do anything.
if (!location.hash) return;
// http://<domain></pathname>?<search><#hash>
// Build an URL for the page, sans the domain and hash
var url = location.pathname;
if (location.search) {
// Include the query string, if any
url += '?' + location.search;
}
// Replace the loaded url with the built url, without reloading the page.
history.replaceState('', document.title, url);
}
시도해 보셨습니까? 그렇다면 무엇입니까? 그렇지 않다면, 왜 안 되니? – Tomalak
안녕하세요. 다시 쓰기 엔진을 사용하려고했지만 실패했습니다. 이 문제를 해결하는 방법에 대한 아이디어가 있으십니까? –
그건 어떻게 작동하지 않습니다. 당신은 당신이 시도한 것을 게시하고 어디에서 붙어 있는지 설명하고, 우리는 당신을 도와줍니다. 여기에는 독자적으로 작업을 해결하려는 노력을 보여주는 코드가 게시됩니다. – Tomalak