Hello i want to use url rewriting in my core php web page site.. can some me help me ??

For Example :-
My web page url link is
www.demo.com/abc.php
i wana to show that page in url like
www.demo.com/abc

can some one tell me how can me solve that probleum ..?

Thanx

Recommended Answers

All 6 Replies

Not in PHP but in your .htaccess file you can put this:

RewriteEngine on
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME}.php -f
RewriteRule ^(.*)$ $1.php

That will remove the .php from the end of the URL

Dear GliderPilot,
As per u said to me.i am creat new file with .htaccess (EXE)
and insert your code in that file ..
but its continue is showing the .php (EXE) with my page ..
can u tell me what to do ..? how can me solve that probleum ..?

thanx

Here is a website that tells you alot of useful things Click Here. But when in doubt, go to the apache website
Click Here.

Member Avatar for diafol

WHat does (EXE) signify?
The .htaccess should be in the directory of the page that you are viewing, if that makes sense.

Dear diafol,

I mean to say me save that file me with .htaccess...
So can u help me in this probleum ?

Thanx

Member Avatar for diafol

Sorry I don't understand. With what exactly do you need help?

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.