SEO | Link Popularity | Search Engine Consulting | SEO Tutorial | SEO Tools | SEO Forum
Reply
 
Thread Tools Rate Thread Display Modes
  #11  
Old 11-13-2006, 07:08 AM
RyanSmith RyanSmith is offline
SEO
 
Join Date: Sep 2005
Location: Fort Collins, Colorado
Posts: 446 RyanSmith will become famous soon enoughRyanSmith will become famous soon enough
That's pretty much the same code as I have for www (dot) advanced-energy (dot) com.

I have a few other tricky settings in there because I'm setting it up for internationalization and all the values are from the database but the general idea is the same. There are also a couple of trick things to make the URL rewrites work, but the end result is awesome in my opinion.
__________________
AJAX Example Sites is now here! With a nice
AJAX Chat Application Tutorial
Reply With Quote
  #12  
Old 11-13-2006, 08:18 AM
BSolveIT's Avatar
BSolveIT BSolveIT is offline
SEO
 
Join Date: May 2005
Location: England, UK
Posts: 621 BSolveIT has a spectacular aura aboutBSolveIT has a spectacular aura about
Send a message via MSN to BSolveIT
Quote:
Originally Posted by RyanSmith
There are also a couple of trick things to make the URL rewrites work, but the end result is awesome in my opinion.


Ohhh... cool! Do tell? (with some code samples if you can)
I do like the url rewrite capability thats built in now, in .Net 2.0, but I've not experimented with it a great deal on dynamic pages.
Reply With Quote
  #13  
Old 11-13-2006, 08:29 AM
RyanSmith RyanSmith is offline
SEO
 
Join Date: Sep 2005
Location: Fort Collins, Colorado
Posts: 446 RyanSmith will become famous soon enoughRyanSmith will become famous soon enough
Actually the URL rewrite with .NET 2.0 is crap. They didn't build in a full baked solution because IIS 7 is going to have URL rewrite capability natively - and all I can say is it's about time. Essentially, the .NET 2.0 rewrite is useless unless you have a specific static page you want to redirect to, and you can easily do that with a 301. There is no support for Regular Expressions making any reasonable solution impossible.

For now I'm using http://www.isapirewrite.com/ with excellent results

I was using the free http://www.iismods.com/url-rewrite/index.htm, but it was crashing the live server for some reason. I use it on other sites with lots of luck so I'm not sure what the issue is.

Basically, all my pages are dynamically created from a database using a single page Content.aspx Then I pass in a "friendly" URL to keep the URLs pretty. To the backend ASP.NET site the requests look like:
/Content.aspx?friendy=Page_Name
but to the end user it looks like:
/en/Page_Name.html

The rewrite is pretty simple:
Code:
RewriteRule .*/en\/(.*)\.html\?(.*) /Content.aspx?friendly=$1&$2 [L]
RewriteRule .*/en\/(.*)\.html /Content.aspx?friendly=$1 [L]


You need the first one in case there are parameters passed. I think I only do on one page so I could make it more hardcoded than that, but why not plan for flexibility.

I'll try to get some better code examples up later.
__________________
AJAX Example Sites is now here! With a nice
AJAX Chat Application Tutorial
Reply With Quote
Reply


Thread Tools
Display Modes Rate This Thread
Rate This Thread:

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


Login/Register
User Name
Password
Remember Me?

Forum Links
Forum Home
SEO Forum
Internet Marketing Forum
Web Design Forum
Web Hosting Forum
Programming Forum
SEO Chat

Quick Links
Forum Home
New Posts
Mark Forums Read
Open Buddy List
User Control Panel
Edit Avatar
Edit Profile
Edit Options
Miscellaneous
Subscribed Threads
My Profile

Search Forums

Advanced Search
All times are GMT -8. The time now is 10:00 AM.


Powered by: vBulletin Version 3.0.3
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.