CodeIgniter Forums
HTACCESS Question - Printable Version

+- CodeIgniter Forums (https://forum.codeigniter.com)
+-- Forum: Archived Discussions (https://forum.codeigniter.com/forum-20.html)
+--- Forum: Archived Development & Programming (https://forum.codeigniter.com/forum-23.html)
+--- Thread: HTACCESS Question (/thread-59626.html)



HTACCESS Question - El Forum - 10-28-2013

[eluser]razerone[/eluser]
Hi.

I have a current HTACCESS file the removes the index.php

But it only removes it from the main directory.

I have a folder in which I do my testing in called rnd.

In that I have subfolders which contain my testing sites.

i.e. http://www.yourdomain.com/rnd/rnd02/

When I want to view the page in http://www.yourdomain.com/rnd/rnd02/ I have to type full length like http://www.yourdomain.com/rnd/rnd02/index.php/hmvctest I will work that way.

But I want it to work with out the index.php http://www.yourdomain.com/rnd/rnd02/hmvctest I have tried many different HTACCESS examples but non of them seem to work for sub sub folders/pages.

Do you guys have any idea what I should do.


HTACCESS Question - El Forum - 10-29-2013

[eluser]noideawhattotypehere[/eluser]
well i guess your folder structure looks like that
/root
----index.php - main site
----htaccess - lets call it main_one
----rnd02
--------rnd02
------------index.php
------------htaccess - submain_one

So basically what you need is add a rule in main_one not to rewrite anything when url is domain.com/rnd02/*, it works when you add index.php cuz there is a condition not to rewrite if you request a file. Otherwise every request is routed to main sites index.php.





HTACCESS Question - El Forum - 10-29-2013

[eluser]razerone[/eluser]
[quote author="noideawhattotypehere" date="1383033422"]well i guess your folder structure looks like that
/root
----index.php - main site
----htaccess - lets call it main_one
----rnd02
--------rnd02
------------index.php
------------htaccess - submain_one

So basically what you need is add a rule in main_one not to rewrite anything when url is domain.com/rnd02/*, it works when you add index.php cuz there is a condition not to rewrite if you request a file. Otherwise every request is routed to main sites index.php.


[/quote]

I got it working thanks any way. I created sub domain few hours ago and tried with htaccess there and it worked now I know what to do.


HTACCESS Question - El Forum - 10-29-2013

[eluser]Tpojka[/eluser]
Few things regardless of subdomain solution:

On user guide URLs page we have simpliest way of apache code (can be extended to something else):
Code:
RewriteEngine on
RewriteCond $1 !^(index\.php|images|robots\.txt)
RewriteRule ^(.*)$ /index.php/$1 [L]
which is work as we all know.

Should in second line be:
Code:
RewriteCond $1 !^(index\.php|images|robots\.txt|rnd02)
so direct access to rnd02 folder would be granted?
Than in that folder you can make new application with specific htaccess rule or else?

Maybe could work.