I'm trying to change the name from my url's to for example home instead of index.php. I've read you can do that with the .htaccess file but for that you need Apache stuff and I don't have anything like that.
Isn't there any more easy way to change the url?
Yes, there is an easy way to change the URL without using the .htaccess file. This can typically be done by using a web framework or a CMS (Content Management System) such as WordPress, Laravel, or Django. These frameworks and CMSs have built-in functionality for handling URL routing, which allows you to define custom URLs for your pages.
Another way is to use a URL rewriting module provided by your web server software such as IIS URL Rewrite for IIS web server, or mod_rewrite for Apache. These modules allow you to rewrite URLs on the server side without requiring changes to the actual file structure on the server.
Without more information about your web server, it's difficult to give more specific instructions. But you could check the documentation or the community forum of your web server or the language framework you're using to find more information about how to change the URLs in your application.
Related
I have setup a Symphony framework on my localhost using this tutorial. I am using the PHP default server and MySQL.
The frontend URL is working fine but when I go to the admin URL (http://localhost:8000/symdemo/admin), then my CSS URL is also redirected to the admin page meaning I am not getting CSS code into the response.
The reason as that the default PHP server does not have a URL-rewriting module and index.php is also adding to the CSS path.
How can I fix this?
I'm not 100% sure, but I think you'll find that using a webserver that supports rewrites is quicker than trying to replicate the necessary rewrites in PHP. Rewrites are listed as a requirement in Symphony CMS's readme, and last time I checked Symphony was still dependent on webserver rewrites for some of its routing/files.
You can, of course, use Apache. If you'd like to use a lighter and cleaner webserver that's easy to configure, I recommend Hiawatha, which has a Symphony URL toolkit/rewrite rule set available.
I am considering building my PHP project in Google App Engine (GAE), and I would like to be confident that I could easily port my code to a more standard Apache Tomcat & PHP server if needed. The one aspect that I cannot find a standard implementation for is GAE's app.yaml handlers. Let me define the functionality that I care about:
The ability to explicitly route incoming requests to a specific php script for fulfillment based on URL patterns.
My searches thus far have lead me to the Tomcat .htaccess RewriteEngine. However, it seems like this literally re-writes the URL and redirects the client machine to that URL. Am I wrong? Other than this solution, I have found nothing else that is promising. Can someone suggest a replacement for GAE's app.yaml handlers?
Thanks in advance!
Seems like you are looking for Apache mod_rewrite which lets you setup rewrite rules that are interpreted behinds the scenes and do not change the external URL.
Actually, I've sub folder named 'portfolio' (http://www.mysite.com/portfolio) & for that folder i'm using codeigniter but for the root directory of my site (http://www.mysite.com) i want to use laravel framework and angular.js ?
If you don't plany any shared functionality between the portfolio and the rest of your site (like a common login system for example), there's no problem with using two different frameworks. All you need is a .htaccess file rewriting all portfolio requests to CodeIgniter's front controller.
This is no problem, you only have to separate the requests on the webserver level so that some go to the Laravel framework, and some other go to the Codeigniter part.
Don't expect support inside the framework, though. It's a special solution for your special case. You have to know how to use rewriting URLs with your webserver.
Be careful with url-rewriting and set it up properly, especially for your main site (cancel rewriting for your /portfolio/ folder). Many sites uses Wordpress for their blogs, but another framework/script for main site.
I am trying to build a CMS that will be used by other people, which means that I can't rely on editing the .htaccess files for mdo_rewrite. I have looked up methods for mod rewriting urls from http://example.com/index.php?category=food to http://example.com/category/food but most of them seem to rely on apache and editing the .htaccess file, which would only work if you are creating a script which, like public scripts like Wordpress, rely on being installed on an external user's server. How do I mod_rewrite from within the script so that the script either automatically edits the user's mod_rewrite settings in .htaccess (as in altering the rewrite rule in the file from within the script itself) or some other method that would work fo a CMS script that is solely written in PHP and intended to be used on another server.
If the script you are using, is making use of a popular framework, chances are they have installed a so called "routing" system inside the framework. That by itself allows nice URLs.
In fact, if you're using any commercial script for a webshop or something alike, they probably have a mod, plugin or component that allows nice URLs. Look it up or add additional info please. :-).
Say if you visit my site: http://nesmods.com/page/2/ there isn't actually a /page/2/ on my site, Wordpress somehow catches the URL and generates a page based on the URL. What is the name of this technique?
This redirecting is managed by the mod_rewrite Module of Apache. Normally this is done in the .htaccess file. Depending on the configuration of your FTP program you can see them as hidden files in the Wordpress root directory.
Some further explanations and examples: http://www.workingwith.me.uk/articles/scripting/mod_rewrite - and Google of course.
Clean URLs apparently. Often done through .htaccess files.
There are a few ways to do this, referred to as URL routing or URL rewriting. Wordpress uses URL routing to map URL structures to it's internal functions that generate content.
It can also be done with the web server itself, such as URL Rewriting with Apache mod_rewrite
Apache hava a module of rewrite url。
It is a good search engine optimization。
This is a detail info about rewrite http://httpd.apache.org/docs/2.0/mod/mod_rewrite.html