Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7069247
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 28, 20262026-05-28T05:25:21+00:00 2026-05-28T05:25:21+00:00

AS sometimes happens, I have created what I would say is a hot mess

  • 0

AS sometimes happens, I have created what I would say is a hot mess in my htaccess file. I’ve got several problems, I know I’m internally looping on occasion, and I’m not great at this anyways. I’ve looked through dozens upon dozens of SO questions and tried tons of solutions. The end result is that I’m trying to piece together more than one separate solution to a multi-part problem and I’ve made a real mess. This is exclusively been my mission for days. I’m stuck. Bad.

  • I want mydomain.com/handmade-jewelry to go to mydomain/handmade-jewelry/ (note slash)
  • Then I also have .com/handmade-jewelry/some-piece going to jewelry-details.php?id=some-piece. That works, but it also needs a trailing slash.
  • When I try to show a trailing slash on “/some-piece/”, it redirects out and hits a file not found.

Trust me. I know there’s got to be glaring flaws in my logic here, and I resisted asking this question since Saturday. I know this is super-oft asked. I wouldn’t be asking if I wasn’t dead stuck.

( rewrite all www and non-www requests to https:// ...works fine)
RewriteCond %{HTTP_HOST} ^domain\.com$ [NC]
RewriteRule ^(.*)$ https://www.domain.com/$1 [R=301,L]
RewriteCond %{HTTPS} !=on
RewriteRule .* https://%{SERVER_NAME}%{REQUEST_URI} [R,L]
RewriteCond %{SERVER_PORT} ^80$
RewriteRule .* https://%{SERVER_NAME}%{REQUEST_URI} [R,L]

(redirecting to the page with all the jewelry)
RewriteRule ^handmade-jewelry/$ jewelry-inventory-page.php [L]

RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
(following was a failed attempt.) 
# RewriteCond %{REQUEST_URI} !rock-jewelry/(.*)/$
(following works with no trailing slash, which is needed) 
RewriteRule ^handmade-jewelry/(.*)$ jewelry-details.php?s=$1 [L] 
(if I turn this on, it goes to a 404 looking for "handmade-jewelry/this-piece/index.php?s=thispiece/etc...")
# RewriteRule ^handmade-jewelry/(.*)?/$ jewelry-details.php?s=$1 [L]

Sorry again. I know for a lot of you, this kind of question gets redundant.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-28T05:25:22+00:00Added an answer on May 28, 2026 at 5:25 am

    Try adding the following to your htaccess file in the root directory of your site

    RewriteEngine on
    RewriteBase /
    
    #( rewrite all www and non-www requests to https:// ...works fine)
    RewriteCond %{HTTP_HOST} ^domain\.com$ [NC]
    RewriteRule ^(.*)$ https://www.domain.com/$1 [R=301,L]
    RewriteCond %{HTTPS} !=on
    RewriteRule .* https://%{SERVER_NAME}%{REQUEST_URI} [R,L]
    
    #I believe this is redundant because of the previous rule
    RewriteCond %{SERVER_PORT} ^80$
    RewriteRule .* https://%{SERVER_NAME}%{REQUEST_URI} [R,L]
    
    #if existing file or directory
    RewriteCond %{REQUEST_FILENAME} -f [OR]
    RewriteCond %{REQUEST_FILENAME} -d
    #do nothing
    RewriteRule ^ - [L]
    
    
    #if it does not end with a slash e.g. handmade-jewelry, redirect to with slash
    RewriteRule ^([-a-zA-Z0-9]+)$ /$1/ [L,R=301]
    
    #if it does not end with a slash e.g. handmade-jewelry/some-piece, add the slash
    RewriteRule ^([-a-zA-Z0-9]+/[-a-zA-Z0-9]+)$ /$1/ [L,R=301]
    
    #(redirecting to the page with all the jewelry)
    RewriteRule ^handmade-jewelry/$ jewelry-inventory-page.php [L,NC]
    
    RewriteRule ^handmade-jewelry/([-a-zA-Z0-9]+)/$ jewelry-details.php?s=$1 [L,NC]
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a Hgroup that contains of four panels. Sometimes it happens then when
Sometimes it happens that one missing character in a huge js file ruins the
Hi I would like to have an explanation regarding the following code. Here Sometimes
I have a website, which will be frequently updated. Sometimes changes happen to User
This is an odd behaviour by my D2006 as it happens sometimes only. I
Sometimes we receive stack traces from our customer with wrong line numbers. It happens
Sometimes users mistakenly redirected to ?Process=ViewImages&PAGEID=. When this happens, they get the following error.
Sometimes you come by Zip files with file or directory with some unrecognized characters
Sometimes when using Visual Studio it displays a prompt with a filename: This file
I have not had much experience with VBA, but I sometimes use it at

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.