?
Solved

Need help with Url rewriting in htaccess

Posted on 2009-07-06
1
Medium Priority
?
244 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 2000 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

Three Reasons Why Backup is Strategic

Backup is strategic to your business because your data is strategic to your business. Without backup, your business will fail. This white paper explains why it is vital for you to design and immediately execute a backup strategy to protect 100 percent of your data.

Question has a verified solution.

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

CTAs encourage people to do something specific to show interest in your company, product or service. Keep reading to learn why CTAs should always be thought of as extremely important, albeit small, sections of websites.
When it comes to security, close monitoring is a must. According to WhiteHat Security annual report, a substantial number of all web applications are vulnerable always. Monitis offers a new product - fully-featured Website security monitoring and pr…
Viewers will get an overview of the benefits and risks of using Bitcoin to accept payments. What Bitcoin is: Legality: Risks: Benefits: Which businesses are best suited?: Other things you should know: How to get started:
Learn how to create flexible layouts using relative units in CSS.  New relative units added in CSS3 include vw(viewports width), vh(viewports height), vmin(minimum of viewports height and width), and vmax (maximum of viewports height and width).
Suggested Courses

719 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