EllisLab text mark
Advanced Search
     
Help with HTACCESS file
Posted: 11 April 2012 09:19 AM   [ Ignore ]
Joined: 2012-02-29
76 posts

Hi,

If I’ve got a template group called “mygroup” and I want anything after the Domain name to use that templategroup/template, what do I need to put in the .htaccess file?

For example:

http://mydomain/alpha would use the mygroup/index template
http://mydomain/alpha/beta would use the mygroup/beta template
http://mydomain/alpha/beta/charlie would use the mygroup/beta template with the parameter “charlie”

Any help much appreciated.

 
Posted: 11 April 2012 09:16 PM   [ Ignore ]   [ # 1 ]   [ Rating: 0 ]
Joined: 2007-08-09
99 posts

You could just set that template group to be the default group instead of using htaccess.  Just click on the template group, click “edit group” and check the box that says “Make the index template in this group your site’s home page?”.

 
Posted: 12 April 2012 02:50 AM   [ Ignore ]   [ # 2 ]   [ Rating: 0 ]
Joined: 2012-02-29
76 posts

No that doesn’t help,

It is the default group already, what I said was I need ANYTHING after the domain name to use that templategroup,

so

http://mydomain/alpha would use the mygroup/index template,
http://mydomain/beta would also use the mygroup/index template,

http://mydomain/alpha/beta would use the mygroup/beta template
http://mydomain/charlie/beta would also use the mygroup/beta template

http://mydomain/charlie/delta/alpha would use the mygroup/beta template with the parameter “alpha”
http://mydomain/delta/echo/charlie would use the mygroup/beta template with the parameter “charlie”

Obviously http://mydomain/system would still need to go the the system NOT use the mygroup/beta template.


UKFreelancer.

 
Posted: 12 April 2012 05:51 AM   [ Ignore ]   [ # 3 ]   [ Rating: 0 ]
Joined: 2012-02-29
76 posts

Anyone?

I need http://mydomain/<WHATEVER> to always use the same template group?

 
Posted: 13 April 2012 11:34 AM   [ Ignore ]   [ # 4 ]   [ Rating: 0 ]
Avatar
Joined: 2011-03-03
125 posts

Your best bet to make:

domain.com/alpha/beta -> yourgroup/beta
domain.com/charlie/beta -> yourgroup/beta

Is to write code into yourgroup/index that will pass {segment_2} to the {embed} tag. It’s going to be a resource hog…

 Signature 

Chris
EpicVoyage EE Addons

 
Posted: 08 May 2012 06:10 AM   [ Ignore ]   [ # 5 ]   [ Rating: 0 ]
Joined: 2012-02-29
76 posts

Thanks for all the advice.

Managed to find an alternative solution.

Site is now live, being an Extranet the outside world won;t see it.

UKFreelancer.

 
Posted: 08 May 2012 09:32 AM   [ Ignore ]   [ # 6 ]   [ Rating: 0 ]
Avatar
Joined: 2011-03-03
125 posts

Would you mind sharing what you did?

 Signature 

Chris
EpicVoyage EE Addons

 
Posted: 08 May 2012 10:45 AM   [ Ignore ]   [ # 7 ]   [ Rating: 0 ]
Joined: 2012-02-29
76 posts

Hi,

The client thankfully went with a single login page, not a different login page per client, this resolved a lot of problems I was experiencing,

so I was able to just have one template group not several.

Once a user is logged in, I can grab all the details I need to decide what needs to be displayed.

I do have an .htaccess file, but all it does is remove the index.php from the URL.

Kind regards,

UKFreelancer.

 
Posted: 08 May 2012 10:57 AM   [ Ignore ]   [ # 8 ]   [ Rating: 0 ]
Avatar
Joined: 2011-03-03
125 posts

It’s always great when the requirements are simplified. I feel your pain on the custom login page per client (having built a site that does that) and .htaccess redirects are tenuous at best.

Anyway, glad you found a happy medium.

 Signature 

Chris
EpicVoyage EE Addons

 
Posted: 08 May 2012 11:27 AM   [ Ignore ]   [ # 9 ]   [ Rating: 0 ]
Avatar
Joined: 2011-03-18
677 posts

Well UKFreelancer,

I think, same solution was told by Susansan but you posted that it didn’t help you.

but later you solved your problem with same approach. smile


Best Regards,

 Signature 

Bhashkar Yadav
http://www.sidd3.com