trouble with url rewrite

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

Postby roliver » Fri Apr 19, 2002 6:13 am

Hi,

I want to change the following url:
http://www.mydomain.com/page_name to
http://www.mydomain.com/?page_name

I thought the following rewrite rule would do it but it doesn't:

RewriteRule ^(.*)/(.*)$ $1?$2

I'm new to regular expressions and mod_rewrite.

Any help is greatly appreciated.
R.
roliver
 
Posts: 1
Joined: Thu Apr 18, 2002 4:00 pm
Location: Affinity Insurance Services

Postby Brett » Wed May 15, 2002 10:48 pm

The domain name shouldn't be included in the RewriteRule. Try this:

RewriteEngine on
RewriteRule ^(.*)$ ?$1
Brett
 
Posts: 82
Joined: Tue Jul 10, 2001 4:00 pm
Location: yohost.com


Return to Beginner's Corner

Who is online

Users browsing this forum: No registered users and 59 guests

cron