Tycoon Talk
Become a Big fish!
The number 1 forum for online business!
Post topics, ask questions, share your knowledge.
Tycoon Talk is part of Freelancer.com - find skilled workers online at a fraction of the cost.

Website and Server Administration Forum


You are currently viewing our Website and Server Administration Forum as a guest. Please register to participate.
Login



Reply
Pass current directory through htaccess ErrorDocument
Old 11-17-2009, 03:01 AM Pass current directory through htaccess ErrorDocument
RadGH's Avatar
Skilled Talker

Posts: 76
Name: Radley
Trades: 0
EDIT: I decided on using a different solution, my idea wouldn't have worked as far as I can tell.

Well. Each user has their own folder on my server, and each folder contains an index.php. It's the only web file there, then there are images and thumbnails. I was hoping that I could easily use the htaccess file to redirect for me.

So instead of having it like

http://radgh.com/gallery/RadGH

I could use

http://radgh.com/gallery?User=RadGH

Then the folders would only contain images and thumbnails. I thought that was the easiest way, but have been searching... and it looks like I was wrong.

I have been working on it though, I got the gallery/index.php to work with $_GET. Now I can either replace every user's index.php with a redirect, or... well, thats the only possibility. I'll just make a script to recurse into each folder and change the index.php. Permissions are already set anyway.

...Actually, thinking about it, I wouldn't get an error page if they have an index.php. I just don't know enough about the .htaccess I guess. Other than I can protect a folder and set up a custom 404 page

Last edited by RadGH; 11-17-2009 at 04:50 AM..
RadGH is offline
Reply With Quote
View Public Profile
 
 
Register now for full access!
Old 11-17-2009, 03:56 AM Re: Pass current directory through htaccess ErrorDocument
chrishirst's Avatar
Missing! presumed drunk.

Posts: 41,528
Name: Chris Hirst
Location: Blackpool. UK
Trades: 0
What exactly is that you are TRYING to? There probably is a much better way (one that works)
__________________
Chris. ->> Links are advertising NOT optimising!! <<-
A foolish consistency is the hobgoblin of little minds
Thought for today:- I SEO the only industry where all the cowboys are Indians?
chrishirst is online now
Reply With Quote
View Public Profile Visit chrishirst's homepage!
 
Old 11-17-2009, 04:48 AM Re: Pass current directory through htaccess ErrorDocument
RadGH's Avatar
Skilled Talker

Posts: 76
Name: Radley
Trades: 0
Well. Each user has their own folder on my server, and each folder contains an index.php. It's the only web file there, then there are images and thumbnails. I was hoping that I could easily use the htaccess file to redirect for me.

So instead of having it like

http://radgh.com/gallery/RadGH

I could use

http://radgh.com/gallery?User=RadGH

Then the folders would only contain images and thumbnails. I thought that was the easiest way, but have been searching... and it looks like I was wrong.

I have been working on it though, I got the gallery/index.php to work with $_GET. Now I can either replace every user's index.php with a redirect, or... well, thats the only possibility. I'll just make a script to recurse into each folder and change the index.php. Permissions are already set anyway.

...Actually, thinking about it, I wouldn't get an error page if they have an index.php. I just don't know enough about the .htaccess I guess. Other than I can protect a folder and set up a custom 404 page

Last edited by RadGH; 11-17-2009 at 04:49 AM..
RadGH is offline
Reply With Quote
View Public Profile
 
Old 11-17-2009, 05:11 AM Re: Pass current directory through htaccess ErrorDocument
chrishirst's Avatar
Missing! presumed drunk.

Posts: 41,528
Name: Chris Hirst
Location: Blackpool. UK
Trades: 0
Ok, so you are trying to set up a "virtual folder" system.

The .htaccess directive you need to be looking at is THE_REQUEST or REQUEST_FILENAME

I am most definitely NOT an Apache "expert" so I could not tell you the correct RewriteCond to use however.
__________________
Chris. ->> Links are advertising NOT optimising!! <<-
A foolish consistency is the hobgoblin of little minds
Thought for today:- I SEO the only industry where all the cowboys are Indians?
chrishirst is online now
Reply With Quote
View Public Profile Visit chrishirst's homepage!
 
Reply     « Reply to Pass current directory through htaccess ErrorDocument
 

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





   
RSS Feed  Feeds: RSS   JS   XML
RSS Feed  Feeds for this forum: RSS   JS   XML



Page generated in 0.14778 seconds with 12 queries