Jump to content



Photo

Links Wll Not Work


  • Please log in to reply
1 reply to this topic

#1 dmx1

dmx1

    Newbie

  • Members
  • Pip
  • 4 posts

Posted 3 September 2017 - 2:49 PM

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


  • 0

#2 Larry

Larry

    Administrator/Writer

  • Administrators
  • 4921 posts
  • LocationState College, PA (USA)

Posted 13 September 2017 - 7:25 PM

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. 


  • 0