Solved

Need help with Url rewriting in htaccess

Posted on 2009-07-06
1
228 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
Comment Utility
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

What Should I Do With This Threat Intelligence?

Are you wondering if you actually need threat intelligence? The answer is yes. We explain the basics for creating useful threat intelligence.

Join & Write a Comment

"In order to have an organized way for empathy mapping, we rely on a psychological model and trying to model it in a simple way, so we will split the board to three section for each persona and a scenario and try to see what those personas would Do,…
This code takes an Excel list of URL’s and adds a header titled “URL List”. It then searches through all URL’s in column “A”, looking for duplicates. When a duplicate is found, it is moved to the top of the list. The duplicate URL’s are then highlig…
This video teaches users how to migrate an existing Wordpress website to a new domain.
The viewer will learn how to count occurrences of each item in an array.

744 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

Need Help in Real-Time?

Connect with top rated Experts

16 Experts available now in Live!

Get 1:1 Help Now