man, now i want to do that.
All request to URL :
domain.tld/dir/filename.ext will become that :
domain.tld/dir/index.php?p=filename.ext
I tried many times but it's unsuccessful !! :mad: :mad:
pls help me :rolleyes:
thanks !!!

The first thing you need is mod_rewrite support by your Apache web server. Unfortunately, I'm not so sure how to do that because I've never had a need to do it before.

Create an .htaccess file that says:

RewriteEngine on
RewriteRule ^(.*).([a-z]+)$ index.php?p=$1.$2 [L]

I BELIEVE something like that should work. I haven't tested it or anything.

i have solved it !!
Thank for help me !!
But i find a diffirent way with you !!

Can you tell us what you did to solve your problem, in case someone else has the same question?

my solution is :

RewriteEngine On
RewriteCond %{REQUEST_URI} !index\.php
RewriteRule ^/?((.*)/)?(.*)$ $2index.php?page=$3 [L]

it will redirect all request !!!!

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.