【发布时间】:2021-04-08 18:23:47
【问题描述】:
我开发了一个包含大量文件的网站。 我已经为他们建立了一个目录并放在那里。
我需要知道我是否可以创建自定义 url 路径,以便我的社区看到该 url, https://mywebsite.com 而不是 https://mywebsite.com/modules/webview/pages/index.php。
我还希望用户输入https://mywebsite.com/forum,例如,将他们带到, https://mywebsite.com/modules/webview/addons/forum 然后仍然显示https://mywebsite.com/forum
谢谢。
我在我的网站上使用 Smarty。
如果有帮助,这里是我的配置文件的内容。
<?php
session_start();
$conn = new mysqli("localhost", "root", "", "dev");
if ($conn->connect_error) {
die("Connection failed: " . $conn->connect_error);
}
define ('ROOT_PATH', realpath(dirname(__FILE__)));
define ('INCLUDE_PATH', realpath(dirname(__FILE__) . '/includes' ));
define('BASE_URL', 'http://localhost/');
function getMultipleRecords($sql, $types = null, $params = []) {
global $conn;
$stmt = $conn->prepare($sql);
if (!empty($params) && !empty($params)) {
$stmt->bind_param($types, ...$params);
}
$stmt->execute();
$result = $stmt->get_result();
$user = $result->fetch_all(MYSQLI_ASSOC);
$stmt->close();
return $user;
}
function getSingleRecord($sql, $types, $params) {
global $conn;
$stmt = $conn->prepare($sql);
$stmt->bind_param($types, ...$params);
$stmt->execute();
$result = $stmt->get_result();
$user = $result->fetch_assoc();
$stmt->close();
return $user;
}
function modifyRecord($sql, $types, $params) {
global $conn;
$stmt = $conn->prepare($sql);
$stmt->bind_param($types, ...$params);
$result = $stmt->execute();
$stmt->close();
return $result;
}
?>
【问题讨论】:
-
什么 http 服务器正在运行您的 http 脚本?
-
现在我正在使用最新版本的 php 和 mysql 在 xampp 上运行它
-
我们怎么能知道你的项目的结构和使用的编程技术,而你根本没有提到呢?请添加更多详细信息,否则您的问题将被关闭和/或否决。
-
XAMPP 不是服务器,尽管我们可以猜到您现在正在运行 Apache 2.4。
-
是的,我不擅长用文字解释事情。我在语音通信方面做得更好。我只想制作一个假路径,将用户带到真实文件,同时仍然显示假文件
标签: php breadcrumbs