shah Posted July 12, 2013 Share Posted July 12, 2013 Dear larry I am having a problem with .htaccess file settings. my header file contains this link <li><a href="/index.php">Home</a></li> <li><a href="/shop/goodies/">About Us</a></li> the error shown when i click my home link is The requested URL /index.php was not found on this server. and my file is at wamp/www/ecommerce/ex2/shop All files are included in shop folder(main folder) and my htacsess file contains this code <IfModule mod_rewrite.c>RewriteEngine on# For sales:RewriteRule ^ecommerce/ex2/shop/sales/?$ sales.php# For the primary categories:RewriteRule ^ecommerce/ex2/shop/shop/([A-Za-z\+]+)/?$ shop.php?type=$1# For specific products:RewriteRule ^ecommerce/ex2/browse/([A-Za-z\+\-]+)/([A-Za-z\+\-]+)/([0-9]+)$ browse.php?type=$1&category=$2&id=$3# For testingRewriteRule ^ecommerce/ex2/eshop/(\d+)*$ index.php?id=$0# For HTTPS pages:RewriteCond %{HTTPS} off</IfModule> Please mention the problem with my links or htaccess settings. I am not getting the logic behind the rewrite rule .Please explain it more to understand the real logic behind this code ^ecommerce/ex2/shop/sales/?$ sales.php what the first part is doing and how our website understand all of these linkings. Thanks alot.waiting for your response/ Link to comment Share on other sites More sharing options...
Larry Posted July 13, 2013 Share Posted July 13, 2013 You need to change your links so that they don't start with / but rather start with /ecommerce/ex2/ because that's part of the URL. The same goes for any CSS and JavaScript files that you include, and any image references. Link to comment Share on other sites More sharing options...
shah Posted July 13, 2013 Author Share Posted July 13, 2013 i have changed my link to <li><a href="/ecommerce/ex2/index/">Home</a></li> <li><a href="/ecommerce/ex2/goodies/">About Us</a></li> again i am getting the same error The requested URL /ecommerce/ex2/index/ was not found on this server. (error for home page) The requested URL /ecommerce/ex2/goodies/ was not found on this server. (error for about us) my url shows this link http://localhost/ecommerce/ex2/index/ for index page and for about us it shows http://localhost/ecommerce/ex2/goodies/ Link to comment Share on other sites More sharing options...
Larry Posted July 13, 2013 Share Posted July 13, 2013 Look at what your links were before and what they are in the book. It's not to index/ but to index.php. It's not to goodies/ but to shop/goodies. (Although you need to preface both with ecommerce/ex2/ as previously mentioned. Link to comment Share on other sites More sharing options...
shah Posted July 13, 2013 Author Share Posted July 13, 2013 Now after adding .php with index the home link starts working but the link <li><a href="ecommerce/ex2/shop/goodies/">About Us</a></li> is not working.Showing this error The requested URL ecommerce/ex2/shop/goodies/ was not found on this server. I think it is not able to get goodies file.And tell me where is goodies file in the root folder. Link to comment Share on other sites More sharing options...
shah Posted July 13, 2013 Author Share Posted July 13, 2013 Is there any one who can answer Please.I am stuck at this... Link to comment Share on other sites More sharing options...
Larry Posted July 13, 2013 Share Posted July 13, 2013 Read the forum guidelines. Link to comment Share on other sites More sharing options...
Recommended Posts