Jump to content
Larry Ullman's Book Forums
ameliehub

The Requested Url /Shop/Coffee/ Was Not Found On This Server.

Recommended Posts

Two options for help: you can search the Web and you can use these forums. I'd recommend both. So those are the mod_rewrite rules, similar to those in the book. What is the actual problem you're having? This will also go a lot more smoothly if you read and abide by the forum guidelines, too.

Share this post


Link to post
Share on other sites

Hi Larry,

 

Thanks for your reply.Anyway I made good progress. wishlist and cart links are working fine. But I am facing issue with coffee, goodies and sales button. I tried different way but it didn't work. it is giving me following error-

 

 

Not Found
 
The requested URL /ex2/shop/coffee/ was not found on this server.
 
same thing happening for other two buttons.
 
 
 <IfModule mod_rewrite.c>
RewriteEngine on
# For sales:
RewriteRule ^/shop/sales/?$ sales.php
# For the primary categories:
RewriteRule ^/shop/([A-Za-z\+]+)/?$ shop.php?type=$1
# For specific products:
RewriteRule ^/browse/([A-Za-z\+\-]+)/([A-Za-z\+\-]+)/([0-9]+)$ browse.php?type=$1&category=$2&id=$3
# For HTTPS pages:
RewriteCond %{HTTPS} off
RewriteRule ^/(checkout\.php|billing\.php|final\.php|admin/(.*))$ https://%{HTTP_HOST}/$1 [R=301,L]
%{HTTP_HOST}
</IfModule>
 
currently ex2 folder is placed in c:/wamp/www/ex2
 
all php files are in c:/wamp/www/ex2/html/

 

all html files are in c:/wamp/www/ex2/html/view

 

I am really sorry but right now I don't know what to do. I checked forum and online but can't get proper solution for this

 

thanks

Share this post


Link to post
Share on other sites

Okay, so c:/wamp/www is your Web root directory, as dictated by WAMP. And you're putting your files in  c:/wamp/www/ex2/html/. That means the URL you're using for the site's home page is localhost/ex2/html/, right? So all of your references in mod_rewrite, HTML, etc. must begin with /ex2/html.

Share this post


Link to post
Share on other sites

yes already i did this, but still not working. It is giving same error-

 

 

Not Found
 
The requested URL /ex2/html/shop/coffee/ was not found on this server.

Share this post


Link to post
Share on other sites

you can see my mod_rewrite-

 

 

<IfModule mod_rewrite.c>
RewriteEngine on
# For sales:
RewriteRule ^/ex2/html/shop/sales/?$ sales.php
# For the primary categories:
RewriteRule ^/ex2/html/shop/([A-Za-z\+]+)/?$ shop.php?type=$1
# For specific products:
RewriteRule ^/ex2/html/browse/([A-Za-z\+\-]+)/([A-Za-z\+\-]+)/([0-9]+)$ browse.php?type=$1&category=$2&id=$3
# For HTTPS pages:
RewriteCond %{HTTPS} off
RewriteRule ^/ex2/html/(checkout\.php|billing\.php|final\.php|admin/(.*))$ https://%{HTTP_HOST}/$1 [R=301,L]
%{HTTP_HOST}
</IfModule>

Share this post


Link to post
Share on other sites

Okay, then that would suggest your mod_rewrite isn't working at all. I would first do a very basic test, like this:

RewriteRule ^/ex2/html/test/?$ index.php

That should redirect localhost/ex2/html/test/ to the home page.

Share this post


Link to post
Share on other sites

Hi Larry,

 

Thank you for your help. Finally i find out. I enabled module_rewrite on and also I removed / from rewriterule and now it is working.

 

 

<IfModule mod_rewrite.c>
RewriteEngine on
# For sales:
RewriteRule ^shop/sales/?$ sales.php
# For the primary categories:
RewriteRule ^shop/([A-Za-z\+]+)/?$ shop.php?type=$1
# For specific products:
RewriteRule ^browse/([A-Za-z\+\-]+)/([A-Za-z\+\-]+)/([0-9]+)$ browse.php?type=$1&category=$2&id=$3
</IfModule>

Share this post


Link to post
Share on other sites

Hi Larry,

 

so far everything is working fine apart from checkout. Basically in my .htaccess file if I add following code as you provided then it is giving following error and even I can't see the html folder where the index file is. But if I remove this code then everything is working fine.Can you give me some hints that what could be the reason is?

 

 

Internal Server Error
 
The server encountered an internal error or misconfiguration and was unable to complete your request.
 
Please contact the server administrator, admin@localhost and inform them of the time the error occurred, and anything you might have done that may have caused the error.
 
More information about this error may be available in the server error log.
 
 
 

 

 

# For HTTPS pages:
RewriteCond %{HTTPS} off
RewriteRule ^/(checkout\.php|billing\.php|final\.php|admin/(.*))$ https://%{HTTP_HOST}/$1 [R=301,L]
%{HTTP_HOST}
 
thanks
 
Saif

Share this post


Link to post
Share on other sites

Hi,

 

I am trying to implement payment as cash only. so I don't need credit card verification. In this case what can you advise?

 

thanks

Saif

Share this post


Link to post
Share on other sites

I am trying to create a website for a indian takeaway. In here in UK people give order online so they don't have to call restaurant to give address, name, phone number etc. But they pay cash to delivery man once food is delivered. And also doing this they can easily get order from mainly young generation like students. I like to start with cash only and in future I am gonna add card payment as well.Thanks 

Share this post


Link to post
Share on other sites

I see. Well, if you're not taking payment online you don't strictly need SSL, but I would argue that you should implement it because people expect it and you'll need it when you do start taking payments online.

Share this post


Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...

×
×
  • Create New...