Solved

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

Posted on 2004-05-03
5
618 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
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

Efficient way to get backups off site to Azure

This user guide provides instructions on how to deploy and configure both a StoneFly Scale Out NAS Enterprise Cloud Drive virtual machine and Veeam Cloud Connect in the Microsoft Azure Cloud.

Question has a verified solution.

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

Suggested Solutions

In Solr 4.0 it is possible to atomically (or partially) update individual fields in a document. This article will show the operations possible for atomic updating as well as setting up your Solr instance to be able to perform the actions. One major …
Shoutout to Emily Plummer (http://www.experts-exchange.com/members/eplummer26.html) for giving me this article! She did most of it, I just finished it up and posted it for her :)    Introduction In a previous article (http://www.experts-exchang…
Viewers will learn about basic arrays, how to declare them, and how to use them. Introduction and definition: Declare an array and cover the syntax of declaring them: Initialize every index in the created array: Example/Features of a basic arr…
The viewer will learn the basics of jQuery, including how to invoke it on a web page. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery.: (CODE)

831 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