简体   繁体   English

需要使用 www.mydomain.com/filename/ 而不是 www.mydomain.com/file.php?id=1

[英]need to use www.mydomain.com/filename/ instead of www.mydomain.com/file.php?id=1

www.mydomain.com/filename/ instead of www.mydomain.com/file.php?id=1 www.mydomain.com/filename/而不是www.mydomain.com/file.php?id=1

currently im developing a Auto index site script目前我正在开发一个自动索引站点脚本

From index.php i had put a hyper link to download page Download page and on file.php page i had put从 index.php 我放了一个超链接到下载页面 下载页面和文件。我放了 php 页面

$id=$_REQUEST['id'];
$query = "update mydatabase SET views = views+1 where id ='".$id."'";
$update = mysqli_query($con,$query) or die(mysql_error());
$query = "SELECT * from mydatabase where id='".$id."'";
$result = mysqli_query($con,$query) or die(mysql_error());
$row = mysqli_fetch_assoc($result);


<?php echo $row['id'];?>
<?php echo $row['name'];?>
<?php echo $row['size'];?>

etc.. ETC..

when i click on Download page it redirect me to www.mydomain.com/file.php?id=1 page and show the related file details.当我点击下载页面时,它会将我重定向到www.mydomain.com/file.php?id=1页面并显示相关文件详细信息。

But i really need to change the above url as www.mydomain.com/song/file-name但我真的需要将上述 url 更改为www.mydomain.com/song/file-name

please can anybody advise or help me on this??请问有人可以建议或帮助我吗?

Maybe you can try this on your download page.也许你可以在你的下载页面上试试这个。

history.replaceState(null, null, '/song/file-name')

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 如何在 PHP 中将 www.mydomain.com/page/user/756890 转为 www.mydomain.com - How to turn www.mydomain.com/page/user/756890 to www.mydomain.com in PHP .htaccess www.mydomain.com/index.php?page=home到www.mydomain.com/home - .htaccess www.mydomain.com/index.php?page=home to www.mydomain.com/home 从www.mydomain.com/foo重定向到www.mydomain.com/foo/ - Redirect from www.mydomain.com/foo to www.mydomain.com/foo/ Laravel 4.1使用301永久重定向将所有请求从www.mydomain.com重定向到mydomain.com - Laravel 4.1 Redirect all requests from www.mydomain.com to mydomain.com with 301 permanent redirect 只允许PHP脚本打开网址,如www.mydomain.com/topsecret/1/001.jpg - only allow PHP scripts to open urls like www.mydomain.com/topsecret/1/001.jpg 如何在Javascript代码示例中使用变量:src =“ htp://www.url.com/file.php?id = [3434]” - How To Use Variable In Javascript Code Ex: src=“htp://www.url.com/file.php?id=[3434]” 使用htaccess将www.url.com/x=y重定向到www.url.com/file.php?x=y? - Redirect www.url.com/x=y to www.url.com/file.php?x=y with htaccess? 网址重写:将mydomain.com/index.php更改为mydomain.com/home - URL rewriting: Change mydomain.com/index.php to mydomain.com/home PHP邮件未从mydomain.com发送到Google应用程序电子邮件myname@mydomain.com - PHP mail is not sending from mydomain.com to the google apps email myname@mydomain.com 在Heroku上将app.mydomain.com作为mydomain.com/app运行 - Run app.mydomain.com as mydomain.com/app on Heroku
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM