Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Which alternatives do I have for developing a website navigation without .htaccess?

Tags:

php

navigation

Just in theory: Almost all modern websites work this way:

somedomain.com/layer1/layer2/action

For example:

http://stackoverflow.com/questions/ask

Typically this is done with .htaccess and ModRewrite Engine. A while ago I stumbled over an article that described something which came right out of php. I don't remember the name anymore. That piece of PHP code was aware of the currently opened URL. It was able to tell what domain is called, what TLD is called, what's the first directory, what's the second directory, what's the called file, etc.

I know the Kohana Framework uses this technology, but don't know where to look at. Anyone familiar with this?

like image 474
openfrog Avatar asked Nov 21 '25 08:11

openfrog


1 Answers

What you mean is making use of the PATH_INFO environment variable. See e.g. here

Without access to .htaccess settings, you will however always have one filename.php in the path with this method:

www.domain.com/filename.php/questions/ask/
like image 129
Pekka Avatar answered Nov 23 '25 22:11

Pekka



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!