Welcome to WebmasterWorld Guest from 220.127.116.11
This work on my website server
RewriteRule ^museum/([^/]+).html$ /file-details.php?$1 [L]
What setting do I need to change on localhost so that I do not need to change the rewrite rules before uploading the htaccess file?
The fact that the no-slash path does not work on localhost hints at some difference in the DocumentRoot [httpd.apache.org] path configuration in httpd.conf -- possibly a trailing slash on that path.
That's the most likely cause, but examine your error log file -- Especially the logged path if a rewritten access attempt fails. By examining that path, you can often see where things went wrong in the URL-to-filepath translation process, and this will focus your question.
Also, I suspect that the regex in your rules should be "[^.]", not "[^/]". But that depends on what you're trying to match. It's also possible you might want "[^./]".
This worked with the slash
RewriteRule ^museum/([^/]+).html$ /myfolder/file-details.php?$1 [L]
Am I correct that the server starts to read the
right side of the rule from the root and stops looking for the file at the first slash?
Since I have a few different websites, I thought I would be smart and have a different folder for each one under htdocs. I wasn't ready to start messing with Virtual Hosts but that's what I need to do now.
On a side note: jdmorgan, I ran across a thread the other day that is a couple of years old and you said "I'm not an expert". I smiled because you are like a god to many of us. I really appreciate the help that you give and hope someday that I will be able to contribute as much as you.
I'm not sure how to interpret this, but prepending a slash on the substitution URL (on the right side) tells the server to start at the document root and use the specified path, while leaving the slash off would mean to start in the current (.htaccess) directory, and append the specified path to that. So, it should make no difference if the code is in the root Web-accessible directory, which is why I qualified my statement above.
>I really appreciate the help that you give and hope someday that I will be able to contribute as much as you.
Thank you, and so do I! (We need all the help we can get back here) :)