Php developer
Php developer

Reputation: 446

url rewriting with htacess not working

I have a static website upon which I have performed CMS but when I added .htaccess file for url rewriting its not working. eg. www.example.in/new/index.php to www.example.in/new/index. there are about 50 pages in my website. what shall i do, i m completely lost. this is the first time i m using .htaccess file.

I have written:

RewriteEngine On
RewriteRule ^([a-zA-Z0-9_-]+)$ index.php?user=$1
RewriteRule ^([a-zA-Z0-9_-]+)/$ index.php?user=$1. 

Upvotes: 0

Views: 66

Answers (2)

Jeremy Gallant
Jeremy Gallant

Reputation: 774

You may need to set AllowOverride All in your Apache config.

http://httpd.apache.org/docs/2.0/howto/htaccess.html

Upvotes: 1

user1744166
user1744166

Reputation:

RewriteEngine On
RewriteRule ^new/([a-zA-Z0-9_-]+)$ new/index.php?user=$1
RewriteRule ^new/([a-zA-Z0-9_-]+)/$ new/index.php?user=$1. 

Upvotes: 1

Related Questions