.htaccess htaccess:如何将url hello/ola/ciao/register.php转换为u/u/u/page.php?

.htaccess htaccess:如何将url hello/ola/ciao/register.php转换为u/u/u/page.php?,.htaccess,.htaccess,我已经阅读了一些关于这个主题的帖子和apache文档 我想将urlhello/ola/ciao/page.php转换为u/u/u/page.php以隐藏网站逻辑 如果我写: RewriteRule ^hello/ola/ciao/(.*)$ u/u/u/$1 [R] 或 它返回消息: The requested URL /u/u/u/page.php was not found on this server 我的HTTPD.CONF是: <Directory "C:/workspa

我已经阅读了一些关于这个主题的帖子和apache文档

我想将url
hello/ola/ciao/page.php
转换为
u/u/u/page.php
以隐藏网站逻辑

如果我写:

RewriteRule ^hello/ola/ciao/(.*)$  u/u/u/$1  [R]

它返回消息:

The requested URL /u/u/u/page.php was not found on this server
我的HTTPD.CONF是:

<Directory "C:/workspace">
     Options Indexes FollowSymLinks
     AllowOverride All
     Require all granted
</Directory>

选项索引跟随符号链接
允许超越所有
要求所有授权
因此,我不想重定向到
u/u/u/page.php
,因为服务器上不存在
u/u/u/
文件夹

我只想将url转换为
u/u/u/page.php
,让它更漂亮

  • 有可能得到这个结果吗
  • 是否可以在不重定向的情况下重写url
  • 我必须使用.htaccess、RewriteRule P标志、ProxyPassReverse或PHP脚本
  • 必须启用哪些apache模块
  • 哪个文件夹需要放在.htaccess中?在根文件夹或 还有子文件夹吗
  • 它在主机web空间中工作还是在本地主机上工作

在根目录中尝试此规则

RewriteEngine on
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME} !-l
RewriteRule ^u/u/u/(.*).php$ hello/ola/ciao/$1.php [L]

在根目录中尝试此规则

RewriteEngine on
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME} !-l
RewriteRule ^u/u/u/(.*).php$ hello/ola/ciao/$1.php [L]

我输入了浏览器的地址栏,什么也没发生。我看到网页page.phpdes u/u/u/page.php存在?u/u/u/page.php不存在,hello/ola/ciao/page.php存在。如果我打字,我看如果我打字,我看它可以打字!可以输入并查看吗?所以我得到的结果是您想将
u/u/u/page.php
重写为
hello/ola/ciao/$1.php
或者是其他方式?是其他方式。我想将hello/ola/ciao/$1.php重写为u/u/u/page.php。也就是说,我想键入hello/ola/ciao/$1.php并查看url u/u/u/page.php。u/u/u/page.php不存在我在浏览器的地址栏中键入,什么也不发生。我看到网页page.phpdes u/u/u/page.php存在?u/u/u/page.php不存在,hello/ola/ciao/page.php存在。如果我打字,我看如果我打字,我看它可以打字!可以输入并查看吗?所以我得到的结果是您想将
u/u/u/page.php
重写为
hello/ola/ciao/$1.php
或者是其他方式?是其他方式。我想将hello/ola/ciao/$1.php重写为u/u/u/page.php。也就是说,我想键入hello/ola/ciao/$1.php并查看url u/u/u/page.php。u/u/u/page.php不存在