Solved

rewrite address bar url to include index.php if not there

Posted on 2004-05-03
5
622 Views
Last Modified: 2013-11-18
lets say I have the following site
http://mysite.com/mydir/

I need a way do that is a user goes to mysite.com/mydir
they will be redirected to http://mysite.com/mydir/index.php.

I know index.php is the default, but I want this to be displayed in the address bar. can I use mod_rewrite, and if so how.

just to recap I want all valid combinations of urls to display http://mysite.com/mydir/index.php in the address bar. This includes mysite.com/mydir, mysite.com/mydir/index.php, http://mysite.com/mydir.

any help would be great
0
Comment
Question by:shainegordon
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
5 Comments
 
LVL 51

Expert Comment

by:ahoffmann
ID: 10977938
Redirect /mysite/   http://www.mysite.com/index.php
0
 

Author Comment

by:shainegordon
ID: 10978958
I used php instead to check the $_SERVER['REQUEST_URI'] for the presense of index.php. if not found I echoed a javascript window.location=index.php

that was enough for my needs.
0
 
LVL 51

Expert Comment

by:ahoffmann
ID: 10979038
and how about browsers without JavaScript?

Also keep in mind that your browser still requested a file, otherwhise you could not have used php-code on the server.
0
 
LVL 15

Expert Comment

by:periwinkle
ID: 11785210
No comment has been added to this question in more than 21 days, so it is now classified as abandoned..
I will leave the following recommendation for this question in the Cleanup topic area:

    PAQ - refund

Any objections should be posted here in the next 4 days. After that time, the question will be closed.

Periwinkle
EE Cleanup Volunteer
0
 

Accepted Solution

by:
modulo earned 0 total points
ID: 11812618
PAQed, with points refunded (100)

modulo
Community Support Moderator
0

Featured Post

Portable, direct connect server access

The ATEN CV211 connects a laptop directly to any server allowing you instant access to perform data maintenance and local operations, for quick troubleshooting, updating, service and repair.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
Internal Server Error on 1&1 Apache Server running PERL 3 98
Apache LDAP Authentication 20 72
Unexpected End of File 11 88
Web Development crash course 4 43
Preface This article introduces an authentication and authorization system for a website.  It is understood by the author and the project contributors that there is no such thing as a "one size fits all" system.  That being said, there is a certa…
This article covers the basics of the Sass, which is a CSS extension language. You will learn about variables, mixins, and nesting.
The viewer will learn how to count occurrences of each item in an array.
The viewer will learn how to create and use a small PHP class to apply a watermark to an image. This video shows the viewer the setup for the PHP watermark as well as important coding language. Continue to Part 2 to learn the core code used in creat…

710 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question