Keep Server Online
If you find the Apache Lounge, the downloads and overall help useful, please express your satisfaction with a donation.
or
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.
| |
|
Topic: Mod_Rewrite |
|
Author |
|
barkermn01
Joined: 30 Aug 2008 Posts: 1 Location: Leeds, Uk
|
Posted: Sat 30 Aug '08 13:15 Post subject: Mod_Rewrite |
|
|
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: 7371 Location: Germany, Next to Hamburg
|
Posted: Tue 02 Sep '08 19:30 Post subject: |
|
|
I think you should ask in the mod rewrite forum instead of waiting here.
http://forum.modrewrite.com/ |
|
Back to top |
|
|
|
|
|
|