| | |||||
| ||||||||
| Programming PHP, Perl, Ruby on Rails, AJAX, HTML, XHTML, CSS, JavaScript, MySQL and any other coding topics. |
![]() |
| | LinkBack | Thread Tools |
| | THREAD STARTER #1 (permalink) |
| NamePros Regular Join Date: Jun 2005 Location: Michigan
Posts: 613
![]() ![]() ![]() ![]() | Changing URL's to be SE friendly I own www.sportstix.us I am havig a new ticket site created like it but with a much better custom design rather than a template. The thing i hate tho is how the destinations go to http://sportstix.us/ResultsGeneral.a...etroit+Pistons ????: NamePros.com http://www.namepros.com/programming/288340-changing-urls-to-be-se-friendly.html or http://sportstix.us/ResultsEvent.asp...ina%20Aguilera instead of something like: http://www.sportstix.com/tickets/det...ns-tickets.htm Is there a way to do this quickly, affordably, and easily? Anybody want to do it at a cost? Or is it easy for me to do? What do I change? |
| |
| | #2 (permalink) |
| NamePros Regular Join Date: May 2005 Location: England
Posts: 392
![]() ![]() ![]() | You use a tool in apache called mod_rewrite. Basically in the .htaccess file you specify what it should look for in the url and then convert this behind the scenes to what you want... kinda like a mask. I reccomend these tutorials: http://www.sitepoint.com/article/guide-url-rewriting http://www.yourhtmlsource.com/sitema...rewriting.html Have fun!
__________________ -Beaver6813.com - Web Developer Extraordinaire! |
| |
| | #4 (permalink) |
| Senior Member Join Date: Oct 2006 Location: NJ
Posts: 1,152
![]() ![]() ![]() | Code: RewriteEngine On RewriteRule tickets/detroit-pistons-ticket.htm ResultsGeneral.aspx?stype=0&kwds=Detroit+Pistons
__________________ Web Development |
| |
| | #5 (permalink) |
| NamePros Regular Join Date: May 2005 Location: England
Posts: 392
![]() ![]() ![]() | A much better way would be: Code: <IfModule mod_rewrite.c> RewriteEngine On RewriteRule ^tickets/(.*)\.html$ ResultsGeneral.aspx?stype=0&kwds=$1 [L] </IfModule>
__________________ -Beaver6813.com - Web Developer Extraordinaire! |
| |
| | #7 (permalink) |
| NamePros Regular Join Date: May 2005 Location: England
Posts: 392
![]() ![]() ![]() | In the home directory of your site, or wherever the files are located create a file called .htaccess and insert the stuff i've posted into it.
__________________ -Beaver6813.com - Web Developer Extraordinaire! |
| |
| | #8 (permalink) |
| NamePros Regular Join Date: Oct 2003 Location: Sweden
Posts: 395
![]() ![]() | Combs84, they all assumed you were using Apache as your webserver. Which you are not. If you see .asp you can assume its a IIS webserver. It's easily verified by seeing the headers sent by the server - 'Microsoft-IIS/6.0' (web developer toolbar or firebug, anyone?). Read the comments (and to little extent the original post) at: http://ask-leo.com/does_iis_support_url_rewriting.html In short: IIS is capable if you have the access, patience and energy to do some extra work. |
| |