The UNIX and Linux Forums  
Hello and Welcome from United States to the UNIX and Linux Forums! Thank You for Visiting and Joining Our Global Community.

Go Back   The UNIX and Linux Forums > Special Forums > Web Programming, Web 2.0 and Mashups
.
google unix.com



Web Programming, Web 2.0 and Mashups Discuss Web Programming and Web Server Administration, including LAMP, Apache, MySQL, Flash, HTML, SEO, Mashups and other Web APIs and topics.

More UNIX and Linux Forum Topics You Might Find Helpful
Thread Thread Starter Forum Replies Last Post
html link to images in /tmp directory Solerous Web Programming, Web 2.0 and Mashups 2 11-25-2008 02:00 PM
Difference between hard link and soft link kamakshi s UNIX for Dummies Questions & Answers 2 06-26-2008 08:05 AM
need some info about symbolic link and hard link detective linux UNIX for Dummies Questions & Answers 2 01-08-2008 07:36 AM
Difference between hard link and soft link in unix RAJACHOKALINGAM UNIX for Dummies Questions & Answers 2 08-01-2006 04:10 AM
Differences between hard link and soft link penguin-friend UNIX for Advanced & Expert Users 3 03-08-2002 03:49 PM

Reply
English Japanese Spanish French German Portuguese Italian Dutch Swedish Russian Norwegian Hungarian Hebrew Danish Bulgarian Greek Powered by Powered by Google
 
LinkBack Thread Tools Search this Thread Rate Thread Display Modes
  #1 (permalink)  
Old 07-26-2009
Neo's Avatar
Neo Neo is online now Forum Staff  
Administrator
  
 

Join Date: Sep 2000
Location: Asia Pacific
Posts: 6,680
Rewrite rules to change “link.html?hl=es” to “/es/link.html” etc?

Hey!

Does anyone know how to create rewrite rules to change:

Code:
“link.html?hl=en” to “/en/link.html”
“link.html?hl=jp” to “/jp/link.html”
“link.html?hl=es” to “/es/link.html”
etc?

Where "link.html" changes based on the page request?
  #2 (permalink)  
Old 07-27-2009
Neo's Avatar
Neo Neo is online now Forum Staff  
Administrator
  
 

Join Date: Sep 2000
Location: Asia Pacific
Posts: 6,680
To clarify:

I want to change this:

Code:
http://www.unix.com/?hl=ja
to

Code:
http://www.unix.com/ja/
and, for example:

Code:
http://www.unix.com/index.html?hl=es
to:

Code:
http://www.unix.com/es/index.html
For all translation links on the site that use ?hl=xx
  #3 (permalink)  
Old 08-07-2009
Neo's Avatar
Neo Neo is online now Forum Staff  
Administrator
  
 

Join Date: Sep 2000
Location: Asia Pacific
Posts: 6,680
OK, we solved this problem a few days ago. Too simple, LOL.


Code:
RewriteEngine on
RewriteRule  ^(.*)\?hl=ja http://www.unix.com/ja/$1 [L,R=301]
And generically:

Code:
RewriteEngine on
RewriteRule ^(.*).html\?hl=(.*)$ http://www.unix.com/$2/$1.html [L,R=301]
And the other way

Code:
RewriteEngine on
RewriteRule ^ja/(.*)$ http://www.site.com/$1?hl=ja [L,R=301]
Reply

Bookmarks

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On




All times are GMT -4. The time now is 05:47 PM.


Powered by: vBulletin, Copyright ©2000 - 2006, Jelsoft Enterprises Limited. Language Translations Powered by .
vBCredits v1.4 Copyright ©2007 - 2008, PixelFX Studios
The UNIX and Linux Forums Content Copyright ©1993-2009. All Rights Reserved.Ad Management by RedTyger

Content Relevant URLs by vBSEO 3.2.0