1. Computer problem? Tech Support Guy is completely free -- paid for by advertisers and donations. Click here to join today! If you're new to Tech Support Guy, we highly recommend that you visit our Guide for New Members.

Solved: htaccess links rewriting

Discussion in 'Web Design & Development' started by stardust7178, Jan 8, 2011.

Thread Status:
Not open for further replies.
Advertisement
  1. stardust7178

    stardust7178 Thread Starter

    Joined:
    Mar 22, 2008
    Messages:
    25
    I'm in the process of converting a site with frames to PHP. I use the following rewriting rules to shorten the links:

    Code:
    Options +FollowSymLinks
    RewriteEngine On
    RewriteRule ^([^/]*)\.html$ index.php?cat=1&id=$1 [R,L]
    RewriteRule ^login$ othernews/login.php [R,L]
    RewriteRule ^([^/]*)/([^/]*)\.html$ index.php?cat=$1&id=$2 [R,L]
    It works correctly on my pc. I tried to test the file on the server and it displayed some errors. I didn't have time to look into it so I removed the file, but after I did that all the link showed up broken and the site didn't show up anymore.

    I need help to understand what's going on and fix it. The owner of the site is not happy. Thanks.
     
  2. DrP

    DrP

    Joined:
    Jul 23, 2005
    Messages:
    739
    ...and the errors are...
     
  3. ehymel

    ehymel

    Joined:
    Aug 12, 2007
    Messages:
    696
    stardust,

    So the only thing you did is put the .htaccess file in place on the server, see that it didn't work, then remove it. After that all links are broken. Is that correct?

    Doesn't sound right. We definitely need more details about the errors you saw (check the server logs), and also whether you did *anything* else.
     
  4. stardust7178

    stardust7178 Thread Starter

    Joined:
    Mar 22, 2008
    Messages:
    25
    Thank you DrP and ehymel for offering to help. I figured out that what I had to do was upload an empty file in order to have the rules erased from the memory. I corrected the rules and now it works.
     
  5. jalicia18

    jalicia18

    Joined:
    Dec 9, 2010
    Messages:
    22
    It might be the problem in your hosting server, it means the hosting provider doesn't allow to create an htaccess fiile. I've already seen this kind of problem and solution.. If you want still to create a friendly seo url, first is to navigate their php server by printing phpinfo(); on your php file. Read all of them and find the text about htaccess if enabled or disabled.
     
  6. Sponsor

As Seen On
As Seen On...

Welcome to Tech Support Guy!

Are you looking for the solution to your computer problem? Join our site today to ask your question. This site is completely free -- paid for by advertisers and donations.

If you're not already familiar with forums, watch our Welcome Guide to get started.

Join over 733,556 other people just like you!

Thread Status:
Not open for further replies.

Short URL to this thread: https://techguy.org/973377

  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice