NameSilo

I need a mod rewrite for my Amazon Shop

Spaceship Spaceship
Watch

tigrrra

Established Member
Impact
1
Hey guys i use gostscripter amazon shop and i have been trying to fix the dang mod rewrite but its a pain in the ass i have to make the rules and modify the global php file to reflect the mod rewrite file.

I was wandering if any of you had done this already and would be able to help. I would be willing to pay for someone to get me the files or to fix the mod rewrite to work properly.

the site is at freenethelp .com
 
0
•••
The views expressed on this page by users and staff are their own, not those of NamePros.
AfternicAfternic
I believe i can help

this should help you, note it was copyied from a site, ive used this alot its great and simple

Say for instance you are making a web hosting site want the url http://www.mod_rewrite.dom/something.php?page=12&category=hosting to pass variables back to a php script.

The most obvious thing to do is this.

$pagenumber= $post["page"]
$category=$post["category"]

Whereby you use $post to find out the value of the page, which in this case is 12 and the category which in this case happens to be hosting. There are two things wrong with using urls like this a.they are not user friendly and b.they are not search engine friendly.

You probably want a nice easy to use url that looks more like this.
http://www.mod_rewrite.dom/something.php/page/12/category/hosting

The big problem here is getting the variable values back to the php script displaying the page. The solution is to use a php script that looks more like this

$data = explode("/",$HTTP_SERVER_VARS['PATH_INFO']);
$page = $data[1];
$category = $data[3];

Explanation

the $HTTP_SERVER_VARS['PATH_INFO'] returns the path of the url from where something.php is being accessed so in this case it will return page/12/category/hosting. This then gets exploded or broken down into the array $data

* $data[0] = page
* $data[1] = 12
* $data[2] = category
* $data[3] = hosting

This way you have access to all the data you need for your php script.
One Small Problem

If you look closely you will spot something strange with the resultant url
http://www.mod_rewrite.dom/something.php/page/12/category/hosting

The .php extension right in the middle of the url is a problem, some search engines may recognize this as improper format and wont index your site. And if you leave it out the server wont recognize that it is a php file, that is ofcourse unless you tell the server to treat the file as a .php file even if its missing the extension. So you want the url to look like this
http://www.mod_rewrite.dom/something/page/12/category/hosting

To do this you need to create a .htaccess file (blank text file named .htaccess). And insert the following code

<FilesMatch "^something$">
< ForceType application/x-httpd-php >
</FilesMatch>

First the files match checks for the word 'something' in the url, then the force type directive tells Apache to recognize 'something' as a php file even though there is no extension in the url.
 
0
•••
i would need someone to mod a php file and the .htaccess file to make this work. It should take someone 15-30min to fix this problem and ill pay $20 through paypal once job is done.
 
0
•••

We're social

Domain Recover
DomainEasy — Zero Commission
  • The sidebar remains visible by scrolling at a speed relative to the page’s height.
Back