close ad
WARNING: Do Not Install the DREAMWEAVER CC 2017 Update »
open ad
View Menu

Technical Support Forums

Free, outstanding support from WebAssist and your colleagues

rating

Url Displaying Wrong Content?

Thread began 7/17/2013 2:19 pm by peterm.bruce341471 | Last modified 8/06/2013 4:46 pm by Ray Borduin | 366 views | 6 replies |

peterm.bruce341471

Url Displaying Wrong Content?

Okay, this is strange. I've got an .htaccess file which contains url rewrites but some of them show the wrong content. For example products_detail.php?ProductID=49 has a tidy url which points to it but instead of Product ID 49 being displayed an entire category is listed. This is happening with several of them and I've checked with my host who has said it is to do with the software.

Details attached.

Thanks.

Sign in to reply to this post

Jason ByrnesWebAssist

you have conflicting rules

this rule:
RewriteRule ink$ products_results.php?Search=1&ProductCategoryID[]=2

is overwriting this one:
RewriteRule fluorescent_ink$ products_detail.php?ProductID=118

because they both end with ink


mod rewrite is not my specialty, so i am not entirely sure of the exact syntax, but I believe it should use:
RewriteRule ^ink$ products_results.php?Search=1&ProductCategoryID[]=2
RewriteRule ^fluorescent_ink$ products_detail.php?ProductID=118

to anchor the expression to the start of the string.

Sign in to reply to this post

peterm.bruce341471

Good Answer

Originally Said By: Jason Byrnes
  you have conflicting rules

this rule:
RewriteRule ink$ products_results.php?Search=1&ProductCategoryID[]=2

is overwriting this one:
RewriteRule fluorescent_ink$ products_detail.php?ProductID=118

because they both end with ink


mod rewrite is not my specialty, so i am not entirely sure of the exact syntax, but I believe it should use:
RewriteRule ^ink$ products_results.php?Search=1&ProductCategoryID[]=2
RewriteRule ^fluorescent_ink$ products_detail.php?ProductID=118

to anchor the expression to the start of the string.  




Good answer Jason. I changed the re-writes around so they have different endings and it fixed it! I never knew this was an issue, not come across it before in rewrites.

I'd like to re-write all the urls in the store but the product list pages are tricky because all the product listing are generated from the database. Is there an easy way around this? I can only think of two options, strip the code and manually list the products (drag and defeats the point of the store) or add a column to the database and enter simple urls then change the reference in dreamweaver to point to the new column.

Have I missed a trick? Is there a better way?

Thanks Jason.

Sign in to reply to this post

Jason ByrnesWebAssist

  dd a column to the database and enter simple urls then change the reference in dreamweaver to point to the new column.  



This is your best option. We recently held a webinar on Power Store, and this one of the topics Ray covered.

Sign in to reply to this post

peterm.bruce341471

Brilliant Seminar - But how do you get custom pages to disply?

Jason,

The webinar was great and following those instructions all is working perfectly! Just getting one glitch - the custom pages have a space in the url e.g. page.php?Custom%20Menu=1 but when I write in the .htaccess file thus: RewriteRule ^support$ page.php?Custom%20Menu=1 the page is blank. I've turned on error reporting in page.php but no value shows. If I leave out the %20 the site stops working for obvious reasons.

Any ideas? BTW I take there's no way to permalink the next and previous links on the product display pages?

Thanks for all the help - still got about two and half hours of webinar to watch!

Sign in to reply to this post

Jason ByrnesWebAssist

use an underscore in the rule instead of a space:
RewriteRule ^support$ page.php?Custom_Menu=1

I'm not aware of an easy way to permalink the next and last links, though I have to confess that URL Rewriting is not my specialty.

Sign in to reply to this post

peterm.bruce341471

Lol, mine neither. Okay Jason you've been a great help and the underscore trick is a great answer!

Cheers.

Jason just to close this I have used the technique that was in Ray's webinar and the whole site now has SEO urls including the results.php so delighted with this.

Thanks a lot.

Sign in to reply to this post

Build websites with a little help from your friends

Your friends over here at WebAssist! These Dreamweaver extensions will assist you in building unlimited, custom websites.

Build websites from already-built web applications

These out-of-the-box solutions provide you proven, tested applications that can be up and running now.  Build a store, a gallery, or a web-based email solution.

Want your website pre-built and hosted?

Close Windowclose

Rate your experience or provide feedback on this page

Account or customer service questions?
Please user our contact form.

Need technical support?
Please visit support to ask a question

Content

rating

Layout

rating

Ease of use

rating

security code refresh image

We do not respond to comments submitted from this page directly, but we do read and analyze any feedback and will use it to help make your experience better in the future.

Close Windowclose

We were unable to retrieve the attached file

Close Windowclose

Attach and remove files

add attachmentAdd attachment
Close Windowclose

Enter the URL you would like to link to in your post

Close Windowclose

This is how you use right click RTF editing

Enable right click RTF editing option allows you to add html markup into your tutorial such as images, bulleted lists, files and more...

-- click to close --

Uploading file...