logo
Apache Lounge
Webmasters

 

About Forum Index Downloads Search Register Log in RSS X


Keep Server Online

If you find the Apache Lounge, the downloads and overall help useful, please express your satisfaction with a donation.

or

Bitcoin

A donation makes a contribution towards the costs, the time and effort that's going in this site and building.

Thank You! Steffen

Your donations will help to keep this site alive and well, and continuing building binaries. Apache Lounge is not sponsored.
Post new topic   Forum Index -> Third-party Modules View previous topic :: View next topic
Reply to topic   Topic: Mod_Rewrite
Author
barkermn01



Joined: 30 Aug 2008
Posts: 1
Location: Leeds, Uk

PostPosted: Sat 30 Aug '08 13:15    Post subject: Mod_Rewrite Reply with quote

What i am wanting to do is

if some one gose to any index.php or .html its sends them via open.php?p= i will show you what i meen

Some one gose to
/index.html - get sent to /open.php?p=index.html

then some one gose to
/dir/index.html - get sent to /open.php?p=dir/index.html

I know this is posable but how do i do it i have been trying to do this for 3 days now lol

this is all my code so far the bottom bit is the bit i am trying to get working
Code:

## Setup home page to go via ClearCode ##
DirectoryIndex open.php?p=index.php

## Enable Rewrite ##
Options +FollowSymLinks
RewriteEngine on

## Set Base Dir ##
RewriteBase /ClearCode/

## File Check ##
RewriteCond %{REQUEST_URI} !-f
RewriteCond %{REQUEST_URI} !-d
RewriteRule . open.php?p=error.php [L]

## load page ##
RewriteRule ^(.*)$ open.php?p=%{REQUEST_URI} [L]

## disable index direct request ##
RewriteRule ^(.*)\/index\.html$ open.php?p=$1
RewriteRule ^(.*)\/index\.php$ open.php?p=$1
Back to top
James Blond
Moderator


Joined: 19 Jan 2006
Posts: 7294
Location: Germany, Next to Hamburg

PostPosted: Tue 02 Sep '08 19:30    Post subject: Reply with quote

I think you should ask in the mod rewrite forum instead of waiting here.

http://forum.modrewrite.com/
Back to top


Reply to topic   Topic: Mod_Rewrite View previous topic :: View next topic
Post new topic   Forum Index -> Third-party Modules