LinuxQuestions.org
Help answer threads with 0 replies.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - General
User Name
Password
Linux - General This Linux forum is for general Linux questions and discussion.
If it is Linux Related and doesn't seem to fit in any other forum then this is the place.

Notices


Reply
  Search this Thread
Old 03-08-2005, 07:07 AM   #1
j-ray
Senior Member
 
Registered: Jan 2002
Location: germany
Distribution: ubuntu, mint, suse
Posts: 1,591

Rep: Reputation: 145Reputation: 145
mod_rewrite help needed


Hi, i have this in .htaccess in apache /docroot/dir/

RewriteEngine ON
RewriteRule (^[A-Za-z]+) ../web/$1/index.php
RewriteRule (^[0-9]+) ../web/$1/index.php

1. if someone calls mydomain.com/something
he should be redirected to ../web/something/index.php

this works

if someone calls mydomain.com he should find index.php and should not be redirected anywhere.
i have no clue how to manage that. can u give me a hint? would be great! thanks a lot
 
Old 03-09-2005, 04:41 PM   #2
pcsmith_uk
LQ Newbie
 
Registered: Dec 2004
Distribution: RC3
Posts: 5

Rep: Reputation: 0
We use something similar on my company website. In cases of a complete failure on the site we have something like:

RewriteCond %{REQUEST_URI} !/offline.html
RewriteRule .* /offline.html [R=302]

This, as I'm sure you can see, redirects anything that isn't offline.html to offline.html, apart from itself (preventing redirect infinite loop).

You could use something similar, only rewriting if if it isn't index.php
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Mod_rewrite question hct224 Linux - Newbie 5 02-23-2006 11:03 AM
mod_rewrite questions? cadkins Linux - Software 0 03-25-2005 11:02 AM
mod_rewrite problem jfall Programming 1 02-22-2005 07:05 PM
mod_rewrite to allow only 127.0.0.1? jimieee Linux - Security 2 06-08-2004 04:17 AM
Enableing MOD_REWRITE prtynked General 0 04-01-2002 05:18 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - General

All times are GMT -5. The time now is 02:00 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration