Solved

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

Posted on 2004-05-03
5
615 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
5 Comments
 
LVL 51

Expert Comment

by:ahoffmann
Comment Utility
Redirect /mysite/   http://www.mysite.com/index.php
0
 

Author Comment

by:shainegordon
Comment Utility
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
Comment Utility
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
Comment Utility
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
Comment Utility
PAQed, with points refunded (100)

modulo
Community Support Moderator
0

Featured Post

IT, Stop Being Called Into Every Meeting

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

Join & Write a Comment

Preface In the first article: A Better Website Login System (http://www.experts-exchange.com/A_2902.html) I introduced the EE Collaborative Login System and its intended purpose. In this article I will discuss some of the design consideratio…
This article covers the basics of the Sass, which is a CSS extension language. You will learn about variables, mixins, and nesting.
This tutorial will teach you the core code needed to finalize the addition of a watermark to your image. The viewer will use a small PHP class to learn and create a watermark.
The viewer will learn the benefit of using external CSS files and the relationship between class and ID selectors. Create your external css file by saving it as style.css then set up your style tags: (CODE) Reference the nav tag and set your prop…

728 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

Need Help in Real-Time?

Connect with top rated Experts

10 Experts available now in Live!

Get 1:1 Help Now