htaccess Elite

Hire htaccesselite professional

.htaccess tutorial


All times are UTC - 5 hours





Post new topic Reply to topic  [ 5 posts ] 
Author Message
 Post subject: Redirecting one folder behind the screens
PostPosted: May 6th, '08, 21:12 

Joined: May 6th, '08, 21:03
Posts: 3
Hello,

I would like to do the following:

Let's say the folder structure on my server looks like this:

Code:
http: //example.com/examples/website1
http: //example.com/examples/website1/folderA

http: //example.com/examples/website2/
http: //example.com/examples/website2/folderA

http: //example.com/examples/template/
http: //example.com/examples/template/folderA
http: //example.com/examples/template/folderB

I would like to have a .htaccess file which makes some kind of a redirect, so that users can type in: http://example.com/examples/website1/folderB while they are actually looking to the website in the /template/ folder. The browser URL should be displaying the address with /website1/.

The reason for this is that we are creating websites for customers which are partly the same. We don't want to upload the same data over and over again.

Does anyone know if this is possible? Thanks in advance!


Top
 Profile  
 
 Post subject: Re: Redirecting one folder behind the screens
PostPosted: May 9th, '08, 16:21 

Joined: Oct 30th, '06, 13:55
Posts: 89
This is easily accomplished, but could you provide more examples of urls that will be typed in the browser and the actual file/folder to be displayed?


Top
 Profile  
 
 Post subject: Re: Redirecting one folder behind the screens
PostPosted: May 15th, '08, 00:18 

Joined: May 6th, '08, 21:03
Posts: 3
Thank you for your reply!

All of these:

http: //www.example.com.au/websites/website1/Gen
http: //www.example.com.au/websites/website2/Gen
http: //www.example.com.au/websites/website3/Gen

Should all point to:

http: //www.example.com.au/websites/website_template/Gen

But the display URL should still be (for example) http: //www.example.com.au/websites/website1/Gen

We currently upload the same Gen folder into each website folder now, but this takes up a lot of storage on our webhost.


Top
 Profile  
 
 Post subject: Re: Redirecting one folder behind the screens
PostPosted: May 15th, '08, 03:05 

Joined: Feb 28th, '07, 11:16
Posts: 40
You could place this in the folder /websites/.htaccess
Code:
RewriteEngine On
RewriteBase /
RewriteRule ^([^/]+)/Gen(.*)$ /website_template/Gen$1 [NC,L]


Top
 Profile  
 
 Post subject: Re: Redirecting one folder behind the screens
PostPosted: May 17th, '08, 01:17 

Joined: May 6th, '08, 21:03
Posts: 3
Thank you very much! I'm going to try it soon.


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 5 posts ] 

All times are UTC - 5 hours


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
Powered by phpBB