views:

127

answers:

2

Hi

I have enabled mod_rewrite in my Xampp apache. When I run my php info page, I saw mod_rewrite under Loaded Modules. So I think it's enabled.

Then I create a folder clean-url under htdocs. Inside clean-url folder I have 3 files

1) index.php here I put

Welcome

2) Test. php

3) .htaccess

Here I put RewriteEngine On RewriteRule ^([a-z]+)/([a-z-]+)$ /$1/$2.php [L]

I want to run the index page, and by clicking on that hyper link I want to display the test.php page with URL mydomain/clean-url/test

I know I am in a wrong path. Does any one help me? Or correct me? ALso i don't know any idea about url rewriting and .htaccess. Please help me.

A: 
Mihai Iorga
Thanks. But still it's not working. I got teh error "object Not found.. Error 404"
Testadmin
i didn't get it, where is the .htaccess file? in the clean-url folder?index.php hwre is it, i can't understand the file tree
Mihai Iorga
.htaccess file is inside the clean-url folderhtdocs->clean-url->index.php.htaccess.test.php
Testadmin
A: 

There is a dash in clean-url, but your regex does not recognize it.

Change your .htaccess to

RewriteEngine On
RewriteRule ^([a-z-]+)/([a-z-]+)$ /$1/$2.php [L]

and place it in htdocs/ instead of htdocs/clean-url/.

Zarel
i also tried this. But not helped me. please help m...
Testadmin