473,327 Members | 2,012 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,327 software developers and data experts.

Question about url's

Hello,

I am new to PHP and I am wondering how can I set index.php to default url
when accessing my site.
Eg. http://www.yyyy.com/ will access the file
http://www.yyyy.com/index.php.

And how can I get the same file writing only http://www.yyyy.com/index

And generally, can this be done for all files? Eg.
http://www.yyyy.com/pages/house will access
the page http://www.yyyy.com/pages/house.php

- Terje

--
Using M2, Opera's revolutionary e-mail client: http://www.opera.com/m2/
Jul 17 '05 #1
7 1974
teho wrote:
Hello,

I am new to PHP and I am wondering how can I set index.php to default url
when accessing my site.
Eg. http://www.yyyy.com/ will access the file
http://www.yyyy.com/index.php.
Edit your apache httpd.conf and add index.php to the DirectoryIndex
statement.

And how can I get the same file writing only http://www.yyyy.com/index

And generally, can this be done for all files? Eg.
http://www.yyyy.com/pages/house will access
the page http://www.yyyy.com/pages/house.php
Again , edit your httpd.conf

<Location /house>
ForceType application/x-httpd-php
</Location>

Go to the root of your site and create a file called "house"

touch house
pico house

<?
print "hello from house";
?>

This isn't a redirect - more a case of "if i come across a file called
house, treat it like a php file and execute it"

teho wrote:
Hello,

I am new to PHP and I am wondering how can I set index.php to default url
when accessing my site.
Eg. http://www.yyyy.com/ will access the file
http://www.yyyy.com/index.php.

And how can I get the same file writing only http://www.yyyy.com/index

And generally, can this be done for all files? Eg.
http://www.yyyy.com/pages/house will access
the page http://www.yyyy.com/pages/house.php

- Terje

Jul 17 '05 #2
In article <op**************@news.Individual.net>, teho wrote:
Hello,

I am new to PHP and I am wondering how can I set index.php to default url
when accessing my site.
Eg. http://www.yyyy.com/ will access the file
http://www.yyyy.com/index.php.

And how can I get the same file writing only http://www.yyyy.com/index

And generally, can this be done for all files? Eg.
http://www.yyyy.com/pages/house will access
the page http://www.yyyy.com/pages/house.php


Your webserver has a manual. Read it.

--
http://home.mysth.be/~timvw
Jul 17 '05 #3
On Wed, 28 Apr 2004 16:58:09 +0100, kaptain kernel <no****@nospam.gov>
wrote:
teho wrote:
Hello,

I am new to PHP and I am wondering how can I set index.php to default
url
when accessing my site.
Eg. http://www.yyyy.com/ will access the file
http://www.yyyy.com/index.php.


Edit your apache httpd.conf and add index.php to the DirectoryIndex
statement.

And how can I get the same file writing only http://www.yyyy.com/index

And generally, can this be done for all files? Eg.
http://www.yyyy.com/pages/house will access
the page http://www.yyyy.com/pages/house.php


Again , edit your httpd.conf

<Location /house>
ForceType application/x-httpd-php
</Location>

Go to the root of your site and create a file called "house"

touch house
pico house

<?
print "hello from house";
?>

This isn't a redirect - more a case of "if i come across a file called
house, treat it like a php file and execute it"

teho wrote:
Hello,

I am new to PHP and I am wondering how can I set index.php to default
url
when accessing my site.
Eg. http://www.yyyy.com/ will access the file
http://www.yyyy.com/index.php.

And how can I get the same file writing only http://www.yyyy.com/index

And generally, can this be done for all files? Eg.
http://www.yyyy.com/pages/house will access
the page http://www.yyyy.com/pages/house.php

- Terje



Thanks! It helped me a lot!

- Terje
--
Using M2, Opera's revolutionary e-mail client: http://www.opera.com/m2/
Jul 17 '05 #4
On 28 Apr 2004 16:32:30 GMT, Tim Van Wassenhove <eu**@pi.be> wrote:
In article <op**************@news.Individual.net>, teho wrote:
Hello,

I am new to PHP and I am wondering how can I set index.php to default
url
when accessing my site.
Eg. http://www.yyyy.com/ will access the file
http://www.yyyy.com/index.php.

And how can I get the same file writing only http://www.yyyy.com/index

And generally, can this be done for all files? Eg.
http://www.yyyy.com/pages/house will access
the page http://www.yyyy.com/pages/house.php


Your webserver has a manual. Read it.


I am impressed by your effort to help new users here. When I get into php
I may give something back to others who are trying to learn php from
scratch.
But I bet you never asks a question here, always reading the manual and is
pissed
because someone actually uses this forum for what is here for:

HELPING USERS TO LEARN AND UNDERSTAND!!!

- Terje

--
Using M2, Opera's revolutionary e-mail client: http://www.opera.com/m2/
Jul 17 '05 #5
teho wrote:
I am impressed by your effort to help new users here. When I get into php
I may give something back to others who are trying to learn php from
scratch.
But I bet you never asks a question here, always reading the manual and
is pissed
because someone actually uses this forum for what is here for:

HELPING USERS TO LEARN AND UNDERSTAND!!!


These kind of posts don't help either. You're best bet is to ignore them
rather than retaliate, I do. ;)

--
Justin Koivisto - sp**@koivi.com
PHP POSTERS: Please use comp.lang.php for PHP related questions,
alt.php* groups are not recommended.
Jul 17 '05 #6
teho wrote:

[ ... ]
Eg. http://www.yyyy.com/ will access the file
http://www.yyyy.com/index.php.
If Apache is your server, DirectoryIndex is your friend.

"Apache module mod_dir",
http://httpd.apache.org/docs/mod/mod...directoryindex
And how can I get the same file writing only http://www.yyyy.com/index
I wouldn't publish that URI, if I were you.
And generally, can this be done for all files? Eg.
http://www.yyyy.com/pages/house will access
the page http://www.yyyy.com/pages/house.php


MultiViews usually. More generally, content negotiation.

"Apache Content Negotiation",
http://httpd.apache.org/docs/content-negotiation.html

What you're proposing is a good idea, in my opinion, because URI
suffixes are pointless and potentially harmful. Congratulations.

--
Jock
Jul 17 '05 #7
teho wrote:

[ ... ]
But I bet you never asks a question here, always reading the manual and is
pissed because someone actually uses this forum for what is here for:

HELPING USERS TO LEARN AND UNDERSTAND!!!


Really? I thought this was Usenet. Grow some skin. :-)

--
Jock
Jul 17 '05 #8

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

7
by: nospam | last post by:
Ok, 3rd or is it the 4th time I have asked this question on Partial Types, so, since it seems to me that Partial Types is still in the design or development stages at Microsoft, I am going to ask...
10
by: Andrew Thompson | last post by:
I only dipped back into the Javascript group again recently, after writing this document for regular reference in Java groups.. <http://www.physci.org/codes/sscce.jsp> In a nutshell, it calls...
5
by: Henry | last post by:
HTML is an acronym for Hyper Text Markup Language. But why is it hyper? Too much java . . . http://takeoff.to/henry
2
by: kimshapiro100 | last post by:
Question on PhP, MySQL I am thinking of a consumer internet business for which I will have to have a database driven site built. I am thinking of using PhP, MySQL as the main technologies...
8
by: Hardy Wang | last post by:
Hi: Is it possible for me to create/open web application from remote machine other than port 80? And create application directly under virtual web site instead of creating a virtual directory?...
10
by: Rider | last post by:
Hi, simple(?) question about asp.net configuration.. I've installed ASP.NET 2.0 QuickStart Sample successfully. But, When I'm first start application the follow message shown. ========= Server...
13
by: Eric_Dexter | last post by:
All I am after realy is to change this reline = re.line.split('instr', '/d$') into something that grabs any line with instr in it take all the numbers and then grab any comment that may or may...
0
by: Ken North | last post by:
If you submit the best question for the workshop at LinkedData Planet, you'll win admission to the conference, including keynotes by W3C Director Sir Tim Berners-Lee, IBM CTO for Information...
0
by: Ken North | last post by:
If you submit the best question for the workshop at LinkedData Planet, you'll win admission to the conference, including keynotes by W3C Director Sir Tim Berners-Lee, IBM CTO for Information...
3
by: Zhang Weiwu | last post by:
Hello! I wrote this: ..required-question p:after { content: "*"; } Corresponding HTML: <div class="required-question"><p>Question Text</p><input /></div> <div...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
1
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.