htaccess URL Rewrite

I need to make my URL clean so that they look something like

http://www.mysite.com/new/about-us

is equal to

http://www.mysite.com//new/page.php?id=about-us

not really sure how to do this..

thanks
bradley525Asked:
Who is Participating?
 
bradley525Author Commented:
Yes I am useing control panel, the .htaccess file is

RewriteEngine On 
RewriteRule ^new/([^/]+)$ new/page.php?id=$1

Open in new window


it is not doing anything though.
0
 
käµfm³d 👽Commented:
Put "http://www.mysite.com/new/about-us" in your page(s). Then create a rewrite rule in your.htaccess to do the transformation:

RewriteRule ^new/([^/]+)$ new/page.php?id=$1

Open in new window

0
 
bradley525Author Commented:
I added the htaccess file but I get a 404 error using

http://www.mysite.com/new/about-us
0
Free Tool: IP Lookup

Get more info about an IP address or domain name, such as organization, abuse contacts and geolocation.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

 
käµfm³d 👽Commented:
Do you have mod_rewrite enabled, and in which .htaccess file did you place the rule?
0
 
Robert SaylorSenior DeveloperCommented:
it has to be enabled in apache. Are you using a control panel? What level of access do you have to your server?
0
 
bradley525Author Commented:
got it working, since I am working in the folder "new" I do not need the "new/" in the code above, i just used


RewriteEngine On 
RewriteRule ^new/([^/]+)$ page.php?id=$1

Open in new window

0
 
bradley525Author Commented:
This works perfect if you are in the root folder, if not just remove the "new/" and it will work...thanks
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.