...

View Full Version : URL masking with page parameters



htcilt
04-01-2010, 09:23 AM
Hi,

I have a site that contains info.php that takes a page parameter and includes another file as defined in an array.

The possible urls are:


info.php?page=1 - pulls in aboutus.php
info.php?page=2 - pulls in contactus.php

I'm trying to us mod_rewrite to give me the following urls:


http://www.mysite.com/info/aboutus
http://www.mysite.com/info/contactus

I've half got it working with:

RewriteRule ^page/([^/\.]+)/?$ info.php?page=$1 [L]

this gives:

http://www.mysite.com/page/1

also for some reason my relative paths are messed up - its looking in page/image and page/css instead of root/images root/css :confused:

htcilt
04-01-2010, 10:03 AM
I expected the following to work, but it didn't

htaccess

RewriteRule ^info/([^/\.]+)/?$ info.php?page=$1 [L]

expected url

http://www.mysite.com/info/1

Just got a 500 internal error.

htcilt
04-01-2010, 10:36 AM
Getting there...

The above didn't work because I have a rewrite so .php isn't needed in the url.
I renamed info.php to information.php and used info in the url.


RewriteRule ^info1/([^/\.]+)/?$ info.php?page=$1 [L]

I'm still having problems with the base url. I've tried RewriteBase / just before the above RewriteRule but no joy.



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum