Forum Moderators: phranque
Currently this is an example of what the homepage appears like
http://www.example.com.au/metadot/index.pl
Is there anyway to change it to look like this
http://www.example.com.au
I need an example of what a rewrite rule would look like for the example above as I am having trouble understanding all the Mod_Rewrite rules, A simple example might help me grasp the understanding
This link represents the Contact Us link
http://www.example.com.au/metadot/index.pl?id=1861&isa=Category&op=show
How would I change this to look like?
http://www.example.com.au/contact
Thanks in Advanced, Russell
[yourhtmlsource.com...]
(Note that WebmasterWorld does not allow the posting of non-authoritative site URLs. The link above is sufficiently useful as to be permitted. However, please be aware that this is an exception.)
Try a search on WebmasterWorld for "RewriteRule static URL dynamic" and similar to turn up dozens of actual implmentations.
For more information, see the documents cited in our forum charter [webmasterworld.com] and the tutorials in the Apache forum section of the WebmasterWorld library [webmasterworld.com].
Jim
http://www.example.com.au/metadot/index.pl
Is there anyway to change it to look like this
http://www.example.com.au
is this possible or not, I'm getting confused. I read articles to say it is possible, then I read the article below that says it's not possible
Beginning Mod Rewrite
[webmasterworld.com...]
What you Cannot Do:
You cannot use mod_rewrite to change the address displayed in the browser... including to a more 'friendly' URL - The location displayed must either be requested or redirected to. The location does not need to contain any information, but must exist in a request.
Thankyou, Russell
So, the procedure is: Change your site so that its pages show 'short' or 'search-engine-friendly' URLs. Then use mod_rewrite to 'map' those URLs back to the correct files when someone uses a short URL to make a request to your server.
The most confusing point is that of direction -- what is rewritten from and what is rewritten to. Mod_rewrite changes the filename associated with a URL. And it does so after that URL request arrives at your server, and before any content-handlers or scripts are invoked. In other words, it is a front-end process in handling a request, and not any kind of back-end page-content/output modifier.
The new short URL must contain sufficient information to re-construct the unique 'real' filename. Much planning should go into this, since a well-planned solution will require only one RewriteRule (or a few), while a poorly-planned solution can require one rule for each URL you want to replace. Generally, the more organized the existing URLs are, the easier it is to replace them.
Jim