相关疑难解决方法(0)

如何从URL中删除.html?

如何.html从静态页面的URL中删除?

此外,我需要将任何网址重定向到没有网址的网址.html.(即www.example.com/page.htmlwww.example.com/page).

html .htaccess

97
推荐指数
10
解决办法
21万
查看次数

PHP .htaccess - >漂亮的网址(反向)

我知道如何进行URL的重写,例如: www.example.com/index.php?id=1&cat=3to www.example.com/1/3/(或者其他).我知道.

我不知道的是如何在所有页面中更改我的整个链接以链接到漂亮的URL.我所有网站的链接都是旧时尚(<a href="index.php?id=1&cat=2">),还有很多.

如果用户点击index.php?id = 1,我问是否有人有想法或知道如何自动重定向到那个漂亮的URL.(如果你在网址中更改标题,几乎就像这个网站Stackoverflow).

所以我的预算是......

  1. 使用.htaccess读取index.php?id = 1&cat = 2来重写索引/ 1/3本身再次解释(奇怪)

  2. 一个php文件,用于重定向htaccess重写为原始的...

结论:<a href="index.php?id=1&.....">自动更改为index/1/2


解决了

Options +FollowSymLinks
RewriteEngine On
RewriteBase /

##################################
# This turns index.php?id=1&cat=2 into index/1/2 and then back 'transparent' into    index.php?id=1&cat=2 if you have old fashioned
# links in your site and don't want to change them :)


# Avoid mod_rewrite infinite loops 
# This is critical if you want to use this code

RewriteCond %{ENV:REDIRECT_STATUS} …
Run Code Online (Sandbox Code Playgroud)

php mod-rewrite rewrite friendly-url

5
推荐指数
1
解决办法
8176
查看次数

标签 统计

.htaccess ×1

friendly-url ×1

html ×1

mod-rewrite ×1

php ×1

rewrite ×1