Solved

Need help with Url rewriting in htaccess

Posted on 2009-07-06
1
233 Views
Last Modified: 2012-05-07
Hi, I'm new to htaccess and have no clue how to solve the situation below.
I have a website in 3 languages. An example url for each of this language looks like:
Dutch: http://www.campingkautenbach.lu/camping.php
French: http://www.campingkautenbach.lu/fr_camping.php
German: http://www.campingkautenbach.lu/du_camping.php

I want that it becomes more search engine friendly and is:
Dutch: http://www.campingkautenbach.lu/nl/camping/
French: http://www.campingkautenbach.lu/fr/camping/
German: http://www.campingkautenbach.lu/de/camping/

How can I do this for all the urls on this website?
0
Comment
Question by:Johan85
1 Comment
 
LVL 43

Accepted Solution

by:
ravenpl earned 500 total points
ID: 24786982
RewriteEngine On

RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_URI} ^/nl/([^/]+)/?$
RewriteRule .* /%1.php [L]

RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_URI} ^/(fr|de)/([^/]+)/?$
RewriteRule .* /%1_%2.php [L]
0

Featured Post

Master Your Team's Linux and Cloud Stack

Come see why top tech companies like Mailchimp and Media Temple use Linux Academy to build their employee training programs.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

With more and more people tethered to the internet, advertisers can reach you in new and creative ways. Push notifications on your smartphone, customized advertisements based on your previous searches, and email inboxes filled with promotional pitch…
Color can increase conversions, create feelings of warmth or even incite people to get behind a cause. If you want your website to really impact site visitors, then it is vital to consider the impact color has on them.
This tutorial demonstrates how to identify and create boundary or building outlines in Google Maps. In this example, I outline the boundaries of an enclosed skatepark within a community park.  Login to your Google Account, then  Google for "Google M…
Any person in technology especially those working for big companies should at least know about the basics of web accessibility. Believe it or not there are even laws in place that require businesses to provide such means for the disabled and aging p…

770 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question