简体   繁体   English

如何在我的网站中重定向干净的htacces网址?

[英]how to redirect clean url of htacces in my site?

I have search many times but not find correct answer 我已经搜索了很多次,但是找不到正确的答案

i want to this 我想要这个

my url is domain.com/privacy.php 我的网址是domain.com/privacy.php

and i want to domain.com/privacy/ 我想要domain.com/privacy/

it's possible if yes please tell me how. 如果可以,请告诉我如何。

use something like 使用类似

Options +FollowSymlinks All -Indexes
RewriteEngine On

RewriteBase /

RewriteRule ^privacy.php$ privacy/

To re-write the URL: 要重写URL:

Options +FollowSymlinks
RewriteEngine On
RewriteBase /
######
############
############
######
RewriteRule ^privacy/ privacy.php [NC]

Update: Do you want privacy.php to redirect you to the /privacy too? 更新:您是否也希望privacy.php将您重定向到/ privacy?

RewriteEngine on
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME}\.php -f
RewriteRule ^(.*)$ $1.php

Not sure what you mean but this is my answer to my guess at what you mean 不知道你的意思,但这是我对你的意思的猜测的答案

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

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM