Jump to content

mod_rewrite help. Show visitors content from page /x1 but display /x in browser


Recommended Posts

Was recently doing some work for a client with Wordpress.

 

Basically, I've installed a plugin that translates the blog in different languages.

 

So, if I want the blog in Japanese, I have to visit:

http://www.domain.com/ja

for the translation to trigger/occur.

 

However, my client wants it to be Japanese, but he wants URL to be / and not /ja.

 

So, if someone clicks on a post:

http://www.domain.com/example-post

It should show that domain in the address bar, but return content from

http://www.domain.com/example-post/ja

 

Basically, rewriting so that the url displayed in the address bar is free from the /ja, but the page is rendered in Japanese.

 

I am not sure if you get the hang of what I'm trying to say here, but I hope my explanation was moderately clear, if not entirely. If you need me to explain in more detail, I'll do it gladly.

 

Any help on this issue would be appreciated.

 

Thanks

^ Thanks for the suggestion.

I did not quite understand how I should remove /ja from the fake url.

 

I did try a wildcard rewrite, but it apparently wont work.

 

If I'm correct this code:

RewriteRule ^/(.*)$ http://www.health-issues.net/$1/ja [L]

 

Should do the trick, right? But it does not, strange enough.

im assuming this url is not real, but it has to exist http://www.health-issues.net/$1/ja. It has to be something like http://www.health-issues.net/ja/index.php?language=$1

 

What is the real address??

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.