Solved

Need help with Url rewriting in htaccess

Posted on 2009-07-06
1
235 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

Easy, flexible multimedia distribution & control

Coming soon!  Ideal for large-scale A/V applications, ATEN's VM3200 Modular Matrix Switch is an all-in-one solution that simplifies video wall integration. Easily customize display layouts to see what you want, how you want it in 4k.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
How to create a textarea which saves text in HTML 8 47
How do I pull the base url for use in html links 7 31
asp Google Map 2 30
WordPress 8 27
FAQ pages provide a simple way for you to supply and for customers to find answers to the most common questions about your company. Here are six reasons why your company website should have a FAQ page
Does your audience prefer people in photos or no people? How can you best highlight what you’re selling? What are your competitors doing, and what can you do that is different and unique from them?  Continue reading to learn how to make your images …
This video teaches users how to migrate an existing Wordpress website to a new domain.
The viewer will learn how to look for a specific file type in a local or remote server directory using PHP.

856 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