|
|
|
|
![]() ![]() |
Apr 13 2005, 06:38 PM
Post
#1
|
|
|
Newbie ![]() Group: Members Posts: 2 Joined: 13-April 05 Member No.: 5,624 |
REQUIRED: Internet server (Apache 1.3.33 recomended), php, basic skills with .htaccess
Mod rewrite is cool Apache option, it helps you to make your site URLs simple and clean... also it is perfect for search engines... This is mod rewrite, it replaces : CODE site.com/index.php?include=files?ID=45 with: CODE site.com/files/45 so lets get startet, open notepad, enter this in it: CODE RewriteEngine On // - you are starting rewrite mod :) RewriteBase / // - you set the rewrite base RewriteRule ^(.+)/([0-9]+)/?$ index.php?include=$1&ID=$2 // and rule: // ^(.+) - text ONLY // ([0-9]+) - numbers ONLY DON'T INCLUDE MY COMMENTS IN REAL HTACCESS!! CODE RewriteEngine On RewriteBase / RewriteRule ^(.+)/([0-9]+)/?$ index.php?include=$1&ID=$2 save it as: .htaccess and upload it to the root directory... and that's all work IMPORTANT: there is problem with browsers, browsers don't recognize that folders you tiped are not real so there is problem with images and css style, so just include apsoluthe path this is only basic, if you realy wanna do some serious work with mod rewrite visit: http://httpd.apache.org/docs-2.0/misc/rewriteguide.html as you can see this is also static URL, but can we be shure?! btw. sorry for not so great spelling |
|
|
|
Jul 4 2008, 05:16 AM
Post
#2
|
|
|
Trap Double Mocha Member ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Group: Members Posts: 2,360 Joined: 21-September 07 Member No.: 50,369 |
How to do this mod_rewrite tutorial
Php Mod Rewrite Tutorial I am in the business of outsourcing. I have around 100 branded products for taking outsourced jobs. I have a list of the branded products keywords. I have to design a page maybe in html or php whatever you may think fit with contents about outsourcing. Let us assume this is the below paragraph:- "We are doing outsourcing for the product xxxx since last many years. We have all the resources to manage the outsourcing of the product xxxx. So if you have to outsource the requirement for xxxx, kindly contact us with the details" Now if you take my product list in a text file of 100 product list. I want xxxx in the above paragraph to be replaced by the product keyword typed in search engine. Now let us take for example I have product "H*P La*se*rjet 10*20" suppose if anybody type in the search engine the above keyword and if that keyword is in my list then the xxxx in the above paragraph in yellow should get replaced with the keyword "H*P La*se*rjet 10*20" and presented to the search engine. The output will look similar to the one given below "We are doing outsourcing for the product H*P La*se*rjet 10*20 since last many years. We have all the resources to manage the outsourcing of the product H*P La*se*rjet 10*20. So if you have to outsource the requirement for H*P La*se*rjet 10*20, kindly contact us with the details" Please help me know how to do it ? Any help from SEO Experts is highly appreciated. Kind Regards -reply by A.S.Pardeshi ADMIN ================ You are basically talking about DYNAMIC content. You will need a PHP engine which fetches WORDS out from database. These words are replaced on the fly and the web-page is shown to your user. MOD-REWRITE on the other hand can be used to GENERATE different pages. So, instead of writing 100 static pages, you can use MOD-rewrite to identify the requested page from URL and calling your PHP script with appropriate URL-encoded variables. :-) This Page at Trap17.com uses MOD_REWRITE engine. -Shree (Trap17.com) |
|
|
|
Jul 15 2008, 09:44 AM
Post
#3
|
|
|
Newbie [Level 2] ![]() ![]() Group: [HOSTED] Posts: 39 Joined: 26-June 08 Member No.: 64,213 |
dude, thats awesome!
This will make the url much cleaner Now I know how those site do that ^^ And its funny Thanks! |
|
|
|
Jul 15 2008, 12:53 PM
Post
#4
|
|
|
NERVE: Interception ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Group: [HOSTED] Posts: 553 Joined: 14-April 07 From: Holy Terra Member No.: 41,610 |
REQUIRED: Internet server (Apache 1.3.33 recomended), php, basic skills with .htaccess Mod rewrite is cool Apache option, it helps you to make your site URLs simple and clean... also it is perfect for search engines... This is mod rewrite, it replaces : CODE site.com/index.php?include=files?ID=45 with: CODE site.com/files/45 so lets get startet, open notepad, enter this in it: CODE RewriteEngine On // - you are starting rewrite mod :) RewriteBase / // - you set the rewrite base RewriteRule ^(.+)/([0-9]+)/?$ index.php?include=$1&ID=$2 // and rule: // ^(.+) - text ONLY // ([0-9]+) - numbers ONLY DON'T INCLUDE MY COMMENTS IN REAL HTACCESS!! CODE RewriteEngine On RewriteBase / RewriteRule ^(.+)/([0-9]+)/?$ index.php?include=$1&ID=$2 save it as: .htaccess and upload it to the root directory... and that's all work IMPORTANT: there is problem with browsers, browsers don't recognize that folders you tiped are not real so there is problem with images and css style, so just include apsoluthe path this is only basic, if you realy wanna do some serious work with mod rewrite visit: http://httpd.apache.org/docs-2.0/misc/rewriteguide.html as you can see this is also static URL, but can we be shure?! btw. sorry for not so great spelling So... just to make this clearer, (I'm not really good at .htaccess and only know some basic commands) if I were to make this work for multiple files (i.e. if I were to use phpBB3, and wanted to change the "viewtopic.php", and "viewforum.php" ones to something cleaner I would change the code to something like this:? CODE RewriteEngine On RewriteBase / RewriteRule ^(.+)/([0-9]+)/?$ viewtopic.php?f=* RewriteRule ^(.+)/([0-9]+)/?$ viewforum.php?f=* Would that work? Does it even support wildcards? Or do I have to spend time installing a SEO modification? |
|
|
|
![]() ![]() |
Similar Topics
|
Lo-Fi Version | Time is now: 6th September 2008 - 07:58 PM |