本文介绍了生成SE友好的URL的.htaccess国防部重写的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有它通过get方法获取文件名和网页上显示的URL。

  tvchaska.info/i/
 

这是页面,当u点击任何图像就会去说。

<$p$p><$c$c>http://tvchaska.info/i/output.php?i=http://brothertattoo.co.uk/wp-content/uploads/2011/09/Sexy-Girl-Tattoo.jpg

我希望我的这个URL被改写为tvchaska.info/i/Sexy-Girl-Tattoo.html

我试过下面的规则,但它不能正常工作

  RewriteEngine叙述上
    重写规则^([^ /] *)\。HTML $ /output.php?i=$1 [L]
 

任何一个可以plz帮助我实现这个PLZ?

解决方案

我已经看到你页面上,我给你答案只有我能满足3个女孩你的页面IRL的!只是开个玩笑。

下面是解决方案:

-1:所有的链接不必像:

<$c$c>/i/output.php?i=http://1.bp.blogspot.com/_R2Wo1mDtuko/TGzOFQEhpoI/AAAAAAAACAA/Na-WQ1xe7dY/s1600/sexy.jpg

不过是这样的:

<$c$c>/i/1.bp.blogspot.com/_R2Wo1mDtuko/TGzOFQEhpoI/AAAAAAAACAA/Na-WQ1xe7dY/s1600/sexy.jpg

-2:一旦你修改你的网站,应用这些规则:

  RewriteEngine叙述上
重写规则^ /我/(.*)+ /i/output.php?i=http://$1
 

这将做的工作。

奥利维尔

I've a URL which get file name through get method and display it on the page.

tvchaska.info/i/

this is the page and when u click any image it will go to say

http://tvchaska.info/i/output.php?i=http://brothertattoo.co.uk/wp-content/uploads/2011/09/Sexy-Girl-Tattoo.jpg

I want my this URL to be rewritten as tvchaska.info/i/Sexy-Girl-Tattoo.html

I tried following rule but it is not working

    RewriteEngine On
    RewriteRule ^([^/]*)\.html$ /output.php?i=$1 [L]

Can any one plz help me to attain this plz?

解决方案

I've seen you page, I'll give you the answer only if I can meet 3 girls of your page IRL! Just kidding.

Here's the solution:

-1: all your link don't have to be like:

/i/output.php?i=http://1.bp.blogspot.com/_R2Wo1mDtuko/TGzOFQEhpoI/AAAAAAAACAA/Na-WQ1xe7dY/s1600/sexy.jpg

but something like:

/i/1.bp.blogspot.com/_R2Wo1mDtuko/TGzOFQEhpoI/AAAAAAAACAA/Na-WQ1xe7dY/s1600/sexy.jpg

-2: once you've modified your site, apply those rules:

RewriteEngine On
RewriteRule ^/i/(.*)+ /i/output.php?i=http://$1

This will do the job.

Olivier

这篇关于生成SE友好的URL的.htaccess国防部重写的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

09-15 07:51