rgb192
asked on
want a portion of the url
website.com/file.php
want 'file'
and not .php
http://www.site.net/fileName.php
want fileName
want 'file'
and not .php
http://www.site.net/fileName.php
want fileName
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
The simplest medium would be to add the following code to your .htaccess file. Once done, you should be able to go to http://example.com/index instead of http://example.com/index.html.
Hope this helps.
Options +MultiViews
Keep in mind that this will work only in an instance where you don't have two instances of the same file name. For example, if you have both "index.html" and "index.php", the server will have to make its best guess as to which file you want it to serve up. If you have a /secure/ directory and a file entitled "secure.html", directories take priority over files, so browsing to http://example.com/secure will bring you to the content of that directory and not http://example.com/secure.html.Hope this helps.
ASKER
only using php and not htacess
this solved the problem
thanks
this solved the problem
thanks
Then use explode() again on the last section to separate the last section at the dot.
Will this format for the url be always so simple? Or might it be more complex, such as
http://www.xxx.yyy.zzz.com/abc.def.php ?
If so, precisely define the portion you want, and we can find it.
http://us1.php.net/manual/en/function.explode.php