BetaONE will rise again!


 
Prev Previous Post   Next Post Next
  #6  
Old 14th Jan 05, 04:21 AM
SlickVic78's Avatar
SlickVic78 SlickVic78 is offline
Senior Member
 
Join Date: Sep 2001
Location: New York, USA
Posts: 515
SlickVic78 is an unknown quantity at this point
Quote:
Originally Posted by war59312
Yea that would be great too.

Thanks a ton,
Will

PS: Bet this helps with google too.
Hey Will,

It should help with all search engines. Google started indexing variables within the URL, but to play it on the safe side, it wouldn't hurt to use this method.

Please take note of the edit above. I had to correct the URL you would use if you were to apply the code in my last post.

Here is the code to place within you .htaccess if you want the folder structure. Remember though - since the URL is being re-written, your images may break because of the folder structure. I will comment on that later. Here is the code you would place in the .htaccess if you were to want folder structure URL manipulation:
Code:
RewriteEngine On RewriteRule ^catalog/([^/]+)/([^/]+)(.*)$ /catalog$3?$1=$2 [QSA,N] RewriteRule ^catalog/?$ /catalog.php [QSA,L]
The URL to use for this would be (using above example URL):
Now, the way to fix the image breakage, there are 2 ways:
  1. Have all your images with full paths (ex- http://www.mydomain.com/images/image.jpg)
  2. Add more lines to the .htaccess
Let's say you had an image directory (src="images/image.jpg") and a scripts directory (src="scripts/script.js") that needed to be adjusted with how many folders you are using in the URL - you would then use this:
Code:
RewriteRule ^.+(images|scripts)/(.*)$ /$1/$2 [L]
This would bring you back to the doc root for your images and scripts directory. This way it will stay consistant with no images or scripts breaking do to the changing of the URL structure.

If you do not modify this, you will end up with this as an example:
Where it should be:
Also, if you have more than 9 variable pairs (&something=something) within your URL and are running apache >1.3.28 or >2.0.45, you may want to add this line within your .htaccess:
Code:
RewriteOptions MaxRedirects=25
This is to increase the maximum number of redirects from the default value 10 to 25 (these are so called internal redirects). This is an apache prevention for endless loops.

All this I learned from Robert over at http://forum.modrewrite.com/. This guy was totally helpful and has gotten back to me with every question I threw at him.

I hope this helps you out Will as much as it did for me!

Enjoy!
-SlickVic78
__________________
  • Pentium 4 3.20GHz Processor
  • 1 Gig DDR 400MHz RAM
  • 100 Gig 7200 RPM Western Digital HDD
  • 80 Gig 7200 RPM Western Digital HDD
  • Lite-On LTR-52327S CD-RW Burner
  • Lite-On SOHW-1633S DVD Burner
  • ATI Radeon 9700 Pro
  • Sound Blaster Audigy
  • Microsoft Windows XP Pro SP-2
Reply With Quote
 


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
URL redirect not working Darkwolven Feedback and Suggestions 5 26th Nov 04 09:17 AM
IE URL Spoofing Bug; SP2 Users Not Affected NewsBot NeoWin News 0 30th Oct 04 11:00 PM


All times are GMT +1. The time now is 02:28 AM.


Design by Vjacheslav Trushkin for phpBBStyles.com.
Powered by vBulletin® Version 3.6.5
Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.