Solved

Need help with Url rewriting in htaccess

Posted on 2009-07-06
1
236 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
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

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
AWS EC2 HTTP & HTTPS 2 79
Un-Indent Setting Notepad++ 3 27
Is sending authentication through SOAP secure? 3 38
Print a <div></div> only 5 40
Because your company can’t afford for you to make SEO mistakes, you’ll want to ensure you’re taking the right steps each and every time you post a new piece of content. This list of optimization do’s and don’ts can help you become an SEO wizard.
This article will inform Clients about common and important expectations from the freelancers (Experts) who are looking at your Gig.
The viewer will learn how to count occurrences of each item in an array.
Video by: Mark
This lesson goes over how to construct ordered and unordered lists and how to create hyperlinks.

730 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