How to rewrite a URL using htaccess?

Mod_rewrite and .htaccess, URL Shortening?

  • I own a website and I have really long URL's that I want to convert over using slashes for SEO purposes. I've heard of mod_rewrite .hataccess, I have a vague idea about what it is, but I'm no expert. My site is hosted with godaddy running on a windows server and I've heard windows doesn't support mod_rewrite .htaccess is that true? Is shortening your URL's a simple easy task. Should I take the time to learn URL shortening myself, or should I just outsource this service. Here's how I want my URL's to look For example: mysite.com/content.php Converted to: mysite.com/content/ For example: mysite.com/content.php?subject=topic&id=… Converted to: mysite.com/content/topic/70/

  • Answer:

    they are many htaccess generator websites are available i will provide you some of the htaccess websites below http://cooletips.de/htaccess/ Example RewriteEngine On RewriteRule ^index(.*)$ index.php [QSA,L] RewriteRule ^tutorial/([A-Za-z0-9._+-]+)(.*)$ tutorial.php?name=$1 [NC]

Mr. Solo Dolo at Yahoo! Answers Visit the source

Was this solution helpful to you?

Other answers

mod rewrite doesn't work on a windows server. NEVER use a windows server unless you absolutely have to Especially if you aren't using asp.net . Microsoft.com even uses Linux servers. 90% of the worlds websites are on Linux. etc. etc. There are so may disadvantages to MS servers, and then there's all the problems with PHP and MySQL and other server based software ton a MS server... but this isn't the time or place. Here's two possible solutions for you: Solution 1: That being said, I think you could accomplish the same thing by just naming your file index.xxx and putting it in a folder with the desire key phrase. For instance: http://example.com/testing/index.php can be linked to with http://example.com/testing/ or http://example.com/testing Solution 2: Windows server 2008 using the latest IIS can do url rewriting. Of course it's no where near as good or easy as on a LAMP (Linux Apache MySQL PHP) server.

Related Q & A:

Just Added Q & A:

Find solution

For every problem there is a solution! Proved by Solucija.

  • Got an issue and looking for advice?

  • Ask Solucija to search every corner of the Web for help.

  • Get workable solutions and helpful tips in a moment.

Just ask Solucija about an issue you face and immediately get a list of ready solutions, answers and tips from other Internet users. We always provide the most suitable and complete answer to your question at the top, along with a few good alternatives below.