LinuxQuestions.org
Visit the LQ Articles and Editorials section
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.

Notices

Reply
 
LinkBack Search this Thread
Old 12-12-2005, 09:46 PM   #1
xconspirisist
Member
 
Registered: Dec 2002
Location: United Kingdom
Distribution: Ubuntu
Posts: 276

Rep: Reputation: 30
mod_rewrite, simple directory redirect?


This is the bit of my .htaccess which matters, in the root directory:

Code:
RewriteEngine on

RewriteCond %{SCRIPT_FILENAME} !-d
RewriteCond %{SCRIPT_FILENAME} !-f

RewriteRule ^(.*) /thatDirectory/index.php?invalidDir=$1
If somebody goes to www.example.com/images, it goes to images okey.

If somebody goes to www.example.com/thisDirectory/, while "thisDirectory" does not exist, it should forward to "www.example.com/thatDirectory". The name of the directory that doesnt exist should be passed to the page via a HTTP_GET_VARS variable.

At the moment, it forwards and reads files in "thatDirectory", which exist, but when it needs to reference things like style.css and images, they dont work.

I think, this is because the script is coming from "www.example.com/thatDirectory", I think that reqresite files, like .css, images and etc, are being referenced by "www.example.com/thisDirectory" (which does not exist).

Hope that all makes sense. Thanks.

Last edited by xconspirisist; 12-12-2005 at 09:49 PM.
 
Old 12-13-2005, 06:37 AM   #2
xconspirisist
Member
 
Registered: Dec 2002
Location: United Kingdom
Distribution: Ubuntu
Posts: 276

Original Poster
Rep: Reputation: 30
As I dont have any replys yet, just to clarify the question:

How do I redirect, while having images work correctly? At the moment, only the page works.
 
Old 12-19-2005, 04:58 AM   #3
xconspirisist
Member
 
Registered: Dec 2002
Location: United Kingdom
Distribution: Ubuntu
Posts: 276

Original Poster
Rep: Reputation: 30
* el bumpo *
 
Old 12-20-2005, 08:22 AM   #4
xconspirisist
Member
 
Registered: Dec 2002
Location: United Kingdom
Distribution: Ubuntu
Posts: 276

Original Poster
Rep: Reputation: 30
* to the top *
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

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 Off
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
A simple command displaying the size of a directory satimis Linux - Newbie 5 11-24-2004 12:06 AM
Create custom user's directory with simple script dtournas Programming 2 09-09-2004 05:00 AM
Using Select to make a simple directory menu why doesn't it work ctrimble Programming 5 06-07-2004 01:21 AM
simple bind and redirect example, please benazonafunk Linux - Networking 3 08-26-2003 07:43 AM
please help, simple question about redirect output kool Linux - General 4 03-18-2002 09:34 AM


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

Main Menu
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
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration