问题
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?
回答1:
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
来源:https://stackoverflow.com/questions/8178690/generating-se-friendly-url-htaccess-mod-rewrite