I am building an intensive web application and currently all my URLs at the moment are in page.php?action=string format. Don't worry, we have a fall back plan to change all pages quickly to the SEO URLs via a config file.
I want to know two things. What script is running this site:
http://lookbook.nu/ (also http://stackoverflow.com)
If you just look at it, hover over areas, crazy ajax calls, so many subdomain calls, so many clean URLs. What would be the best approach to do this - is this a RoR thing? All the URLs are so clean and structured. It really impressed me.
I am not wishing for a htaccess solution as I am using nginx.
StackOverflow actually runs on ASP.NET MVC, but you have URL rewriting built in Apache too if that's your thing. No clue about nginx, though.
Edit: A simple Google search revealed http://wiki.nginx.org/HttpRewriteModule so you're in luck!
I recently launched CodeIgniter based website for someone who wishes to be advertised and linked to by affiliates, in E-newsletters and the like. This type of linking generally attaches tracking code on the end, in the form of querystrings for analytics.
blah.com/?utm_source=MailingList&utm_medium=email&utm_campaign=Blah+OCt+II
Of course if you hit that, Code Igniter displays an error about disallowed characters in the URL.
It seems that I can get around this by setting this in the config.php:
$config['uri_protocol'] = "AUTO";
This at least stops the error from being displayed. I only need it to be enabled for the homepage so I read online that you can set this in the controller of choice:
parse_str($_SERVER['QUERY_STRING'],$_GET);
I'm assuming that will then let the vars be parsed so the analytics JS code will pick up on it.
Does that all seem safe and logical?
Use the latest version of CodeIgniter, 2.1 has no problems with $_GET at all and 2.0.x should have been fine too.
I have been writing my site with Codeigniter for a while. My site has functions like a social networking site: login, make friends, comments, follow, post status, etc.
I just found out about Elgg, seems great so far.
I want to know, without knowing too much about Elgg, would you usually use it :
as a replacement of CI
or
a compliment to CI
I can rewrite the CI code into Elgg if really neccessary, of course, not something I would like to do.
Elgg is meant to be the backbone of your site. It could be installed alongside Codeigniter, but there's no clear way to integrate them - it's similar to trying to use CI and WordPress together. You probably want to choose one or the other, they are not comparable.
Elgg = Social Networking Engine
Codeigniter = PHP Framework
Elgg is a full-blown solution, while Codeigniter is a means to write one yourself.
I read this
the best way to make codeigniter website multi-language. calling from lang arrays depends on lang session?
for language inclusion...
i wonder how the url will appear for multi languages...
How to show the language in url so that it will also be indexed in search engines...
for example sitenameDOTcom/es or sitenameDOTcom/whoweare/es or something like this and how to sync with the controllers and the urls...
ah, i found an article in the codeigniter forums.
here it is ...
https://github.com/EllisLab/CodeIgniter/wiki/URI-Language-Identifier
previously the url was like the following and now it doesn't work.
http://codeigniter.com/wiki/URI_Language_Identifier/
and here is a live example i am using
http://vikku.info/wordreminder/en
When I look at Amazon.com and I see their URL for pages, it does not have .htm, .html or .php at the end of the URL.
It is like:
http://www.amazon.com/books-used-books-textbooks/b/ref=topnav_storetab_b?ie=UTF8&node=283155
Why and how? What kind of extension is that?
Your browser doesn't care about the extension of the file, only the content type that the server reports. (Well, unless you use IE because at Microsoft they think they know more about what you're serving up than you do). If your server reports that the content being served up is Content-Type: text/html, then your browser is supposed to treat it like it's HTML no matter what the file name is.
Typically, it's implemented using a URL rewriting scheme of some description. The basic notion is that the web should be moving to addressing resources with proper URIs, not classic old URLs which leak implementation detail, and which are vulnerable to future changes as a result.
A thorough discussion of the topic can be found in Tim Berners-Lee's article Cool URIs Don't Change, which argues in favour of reducing the irrelevant cruft in URIs as a means of helping to avoid the problems that occur when implementations do change, and when resources do move to a different URL. The article itself contains good general advice on planning out a URI scheme, and is well worth a read.
More specifically than most of these answers:
Web content doesn't use the file extension to determine what kind of file is being served (unless you're Internet Explorer). Instead, they use the Content-type HTTP header, which is sent down the wire before the content of the image, HTML page, download, or whatever. For example:
Content-type: text/html
denotes that the page you are viewing should be interpreted as HTML, and
Content-type: image/png
denotes that the page is a PNG image.
Web servers often use the file extension if the file is served directly from disk to determine what Content-type to assign, but web applications can also generate pages with any Content-type they like in response to a request. No matter the filename's structure or extension, so long as the actual content of the page matches with the declared Content-type, the data renders as intended.
For websites that use Apache, they are probably using mod_rewrite that enables them to rewrite URLS (and make them more user and SEO friendly)
You can read more here http://httpd.apache.org/docs/2.0/mod/mod_rewrite.html
and here http://www.sitepoint.com/article/apache-mod_rewrite-examples/
EDIT: There are rewriting modules for IIS as well.
Traditionally the file extension represents the file that is being served.
For example
http://someserver/somepath/image.jpg
Later that same approach was used to allow a script process the parameter
http://somerverser/somepath/script.php?param=1234&other=7890
In this case the file was a php script that process the "request" and presented a dinamically created file.
Nowadays, the applications are much more complex than that ( namely amazon that you metioned )
Then there is no a single script that handles the request ( but a much more complex app wit several files/methods/functions/object etc ) , and the url is more like the entry point for a web application ( it may have an script behind but that another thing ) so now web apps like amazon, and yes stackoverflow don't show an file in the URL but anything comming is processed by the app in the server side.
websites urls without file extension?
Here I questions represents the webapp and 322747 the parameter
I hope this little explanation helps you to understand better all the other answers.
Well how about a having an index.html file in the directory and then you type the path into the browser? I see that my Firefox and IE7 both put the trailing slash in automatically, I don't have to type it. This is more suited to people like me that do not think every single url on earth should invoke php, perl, cgi and 10,000 other applications just in order to sent a few kilobytes of data.
A lot of people are using an more "RESTful" type architecture... or at least, REST-looking URLs.
This site (StackOverflow) dosn't show a file extension... it's using ASP.NET MVC.
Depending on the settings of your server you can use (or not) any extension you want. You could even set extensions to be ".JamesRocks" but it won't be very helpful :)
Anyways just in case you're new to web programming all that gibberish on the end there are arguments to a GET operation, and not the page's extension.
A number of posts have mentioned this, and I'll weigh in. It absolutely is a URL rewriting system, and a number of platforms have ways to implement this.
I've worked for a few larger ecommerce sites, and it is now a very important part of the web presence, and offers a number of advantages.
I would recommend taking the technology you want to work with, and researching samples of the URL rewriting mechanism for that platform. For .NET, for example, there google 'asp.net url rewriting' or use an add-on framework like MVC, which does this functionality out of the box.
In Django (a web application framework for python), you design the URLs yourself, independent of any file name, or even any path on the server for that matter.
You just say something like "I want /news/<number>/ urls to be handled by this function"