Mod Rewrite - at a loss....?? Very simple issue

New to mod_rewrite? This is a good place to start.

Mod Rewrite - at a loss....?? Very simple issue

Postby php_guy » Thu Sep 03, 2009 8:02 am

I have been trying to resolve this issue for hours, and have tried everything found on this forum and others... Surely this is just a simple thing? I'm wondering if I'm missing something?

all I want to do is translate /?p=2&lang=e to /page-2.html

There are lots of these pages (eg. p=3, p=4, etc.) so surely there could be a standard bit of code that works for them all

Any ideas? Thanks
php_guy
 
Posts: 1
Joined: Thu Sep 03, 2009 7:45 am

Postby richardk » Thu Sep 03, 2009 5:25 pm

Try
Code: Select all
Options +FollowSymLinks

RewriteEngine On

RewriteRule ^page-([0-9]+)\.html$ /?lang=e&p=$1 [QSA,L]
richardk
 
Posts: 8800
Joined: Wed Dec 21, 2005 7:50 am


Return to Beginner's Corner

Who is online

Users browsing this forum: Google [Bot] and 27 guests

cron