Jump to content
Larry Ullman's Book Forums
Sign in to follow this  
dmx1

Links Wll Not Work

Recommended Posts

Hi,

 

I am a newbie, so please excuse any simple errors I may be making.

 

The address for my php site is:

 

http://localhost:8888/headbands1/

 

All my files are in the 'headbands1' root directory, such as the 'include', 'views', 'shop', 'sales', index.php.

 

I have a file called '_.htaccess.txt' also in the 'headbands1' directory.

 

I don't know if I really need to include the '_.htaccess.txt' file or not.

 

It has the following information in it:

 

<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]
</IfModule>

 

 

 

 

When I click on an image, on the home page, I get an error saying:

 

'The requested URL  /shop/sales/  was not found on this server.'

 

The shop.php and sales.php pages have not been edited in any way.

 

Can you tell me what I can do, so when I click on the 'Sales Item' image, on the home page,  I will not get the above error, and it will take me to the correct page. Thanks

Share this post


Link to post
Share on other sites

Welcome! You do need to use .htaccess and mod_rewrite in order for those URLs to work. However it must be exactly named .htaccess, no underscore, no .txt extension. 

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  

×