|
|||||||
New to SitePoint Forums? Register here for free!
|
![]() |
|
|
Thread Tools | Display Modes |
|
|
#1 |
|
SitePoint Enthusiast
![]() Join Date: May 2009
Location: Melbourne, Australia
Posts: 35
|
.htaccess rewrite rule issue
Hi All,
I'm doing a few changes to an online store and have come across the following issue. Currently links on the webpage (for products) are driven by the below code in the .htaccess file which pulls the corresponding information form an SQL database. PHP Code:
If I try to add in a tenth product with the following code it does not work PHP Code:
It would appear that there are only allowed to be 9 active links? As I’m a little green on this are any assistance would be appreciated. |
|
|
|
|
|
#2 |
|
SitePoint Wizard
![]() ![]() ![]() ![]() ![]() ![]() Join Date: Dec 2005
Posts: 1,128
|
better escape . in rule matching
For example: RewriteRule ^New-Product-K\.php$ /index.php?cPath=1 [L] |
|
|
|
|
|
#3 |
|
SitePoint Enthusiast
![]() Join Date: May 2009
Location: Melbourne, Australia
Posts: 35
|
Hi PHPycho (great name)
It appears that I've missed the \ after the product in my excerpt of code. Unfortunately I am unable to edit it above and still have the issue. |
|
|
|
|
|
#4 |
|
SitePoint Wizard
![]() ![]() ![]() ![]() ![]() ![]() Join Date: Dec 2005
Posts: 1,128
|
|
|
|
|
|
|
#5 |
|
SitePoint Enthusiast
![]() Join Date: May 2009
Location: Melbourne, Australia
Posts: 35
|
hmm I’m out of my depth here (time to hit the books)
I have made the line identical to all others (as per your example) and the new rules will not work, yet simply changing the path on any of the old rules to the new path works. |
|
|
|
|
|
#6 |
|
SitePoint Wizard
![]() ![]() ![]() ![]() ![]() ![]() Join Date: Dec 2005
Posts: 1,128
|
Can you post the error logs?
So that we can help if we got the clue. Thanks |
|
|
|
|
|
#7 |
|
SitePoint Enthusiast
![]() Join Date: May 2009
Location: Melbourne, Australia
Posts: 35
|
I sure can,
Where are the error's logged? |
|
|
|
|
|
#8 |
|
SitePoint Wizard
![]() ![]() ![]() ![]() ![]() ![]() Join Date: Dec 2005
Posts: 1,128
|
|
|
|
|
|
|
#9 |
|
SitePoint Enthusiast
![]() Join Date: May 2009
Location: Melbourne, Australia
Posts: 35
|
|
|
|
|
|
|
#10 |
|
SitePoint Enthusiast
![]() Join Date: May 2009
Location: Melbourne, Australia
Posts: 35
|
Ok I think I have figured it out (simply really *sigh*)
When I open the updated file in notepad (not notepad++) there are a couple of hidden characters in front of the changes I made. If I remove those characters it works (but I loose all the formatting for readability) By opening the original file and my updated file side by side in Notepad++ it appears that they are in different formats. The original can be converted to either Windows or Unix format, so I assume it's in a Mac format. The update can be converted to either Unix or Mac (hence it is in a Windows format I assume) Now on xmapp the windows format works fine but a quick test on the live site resulted in a 500 error. I believe that it may need to be changed to a Mac format and upload so the site is happy. I'll test this later but does my understanding seem logical as to why it would not work? |
|
|
|
|
|
#11 |
|
SitePoint Enthusiast
![]() Join Date: May 2009
Location: Melbourne, Australia
Posts: 35
|
Ok more of an update, By retyping it all for some reason the file now works.
However a new issue has arisen. Loading either the unix or windows version of the file (which run fine on XAMPP) crash the live server. Loading the mac version allows the homepage to come up, then breaks all the links. I fail to understand why this is and here is a copy of the error message. Internal Server Error The server encountered an internal error or a misconfiguration and was unable to complete your request Please contact the server administrator and inform them of the error that occurred. More information about this error will be in the server error log Additionally a 500 Internal Server Error was encountered while trying to use an Error Document to handle the request. I'll keep digging |
|
|
|
|
|
#12 |
|
SitePoint Enthusiast
![]() Join Date: May 2009
Location: Melbourne, Australia
Posts: 35
|
Dig no more...(sorta)
PHPycho, you are not going to believe this. I have solved the issue and have the new links working, But I’m yet to understand why (and I will investigate so to learn why) I noticed then when I FTP the file to the server it was not asking me to confirm an overwrite (which is odd as the file was to be overwritten) Out of frustration (and lack of ideas) I manually rewrote the whole file again in notepad. The difference this time was that I wrote it in my main window (not the virtual machine) Now I go to FTP the file and it asks me to confirm the overwrite. I say yes and presto all works as it should. Now I have no idea why or how but it does. It would appear that there is a difference between my machine and the virtual machine as writing both in notepad (the same version mind you) produced different results? I just need to track down the variable that is different so I can learn to not make the same mistake again. Plus I would like to code in my vm at times. Many thanks for your assistance. |
|
|
|
![]() |
| Bookmarks |
«
Previous Thread
|
Next Thread
»
| Thread Tools | |
| Display Modes | |
|
|
|
All times are GMT -7. The time now is 22:43.










Linear Mode
