Welcome Guest, Not a member yet? Register   Sign In
Right path into app
#1

[eluser]Tominator[/eluser]
Hi guys!

I've got problem with my paths on localhost

I'm developing in folder:

D:/www/work/my_folder/

D:/www/ is set as localhost.

I'd like to use: <a href="/controller/model/">...</a>,
but it redirect me into: http://localhost/controller/model/,
I want to get: http://localhost/work/my_folder/controller/model/.

I can't use PHP for making a link.

I was trying to set my .htaccess, <base>, and httpd.conf but with no success.

Any suggestion?

Tom.
#2

[eluser]WanWizard[/eluser]
You can do this, but that requires a .htaccess in the docroot (D:/www) that captures the requests and rewrites them. Which will make everything else in that directory unreachable, which in turn makes it pointless to put your CI development in a sub-directory.

Some advice:

First, create a dummy domain name (p.e. mywork.domain.local) for this site, and add it to your hosts file (c:/windows/system32/drivers/etc, IP address 127.0.0.1), as you will run into cookie issues when you use 'localhost'.

Second, don't worry if your URL's don't look pretty at this stage. Just make sure that the base_url in your config matches the path (something like http://mywork.domain.local/work/my_folder). When you use the CI methods for creating links, that will use this to create the link, you only have to specify 'controller/method'. When you move your application to another server, update the base_url, and everything keeps working.

If you don't use CI's method for creating links, use
Code:
<a href="&lt;?php echo base_url(); ?&gt;controller/method/param">...</a>
#3

[eluser]Tominator[/eluser]
Can you help me with .htaccess stored in D:/www ? What shout it contain?

I can't use PHP in this case, so I'm trying to write pure HTML, that's why I can't use your second advice.




Theme © iAndrew 2016 - Forum software by © MyBB