Damaged htaccess File With Slug In Link

7 replies
Hi,

I have caused a major problem with my site. I have tried to add a slug to the link.

So instead of..

.com/product/12345

I now have...

.com/product/12345/large-red-widget.

However the changes I have made to my htaccess file have now affected all the other links on my site which run from a query. Can anyone advise how to amend the htacess file just so it impacts on products.

Code:
Options -Indexes     Options -MultiViews     Options +FollowSymLinks      # Prevent viewing of htaccess file     <Files ~ "^\.ht">     order allow,deny     deny from all     satisfy all     </Files>      # Disable directory listing from this point     Options -Indexes      # Error Pages     ErrorDocument 404 /404-error.php      # Rewrite Rules     <IfModule mod_rewrite.c>     RewriteEngine on       RewriteCond %{REQUEST_FILENAME} !-f       RewriteCond %{REQUEST_FILENAME} !-d       RewriteRule ^products/product/([0-9]+)/(.*)$ products/product.php?product_id=$1 [QSA,L]       RewriteRule ^articles/article/([0-9]+)/(.*)$ articles/article.php?ID=$1 [QSA,L]         RewriteRule ^articles/articlesfiltered/([A-Za-z]+)/(.*)$ articles/articlesfiltered.php?articlecategory=$1 [QSA,L]       RewriteRule ^plusstyle/plusstyle/([0-9]+)/(.*)$ plusstyle/plusstyle.php?ID=$1 [QSA,L]        RewriteRule ^plusstyle/plusstylesfiltered/([A-Za-z]+)/(.*)$ plusstyle/plusstylesfiltered.php?articlecategory=$1 [QSA,L]          RewriteRule ^([a-z]+)/([a-z\-]+)$ /$1/$2.php [QSA,L]     </IfModule
#damaged #file #htaccess #link #slug
  • Profile picture of the author RobinInTexas
    I'd try to help but I'm not going to spend the time making your htaccess file readable by adding linefeeds. The webserver may be able to read what's there, but I can't do it easily.
    Signature

    Robin



    ...Even if you're on the right track, you'll get run over if you just set there.
    {{ DiscussionBoard.errors[8286809].message }}
  • Profile picture of the author justlukeyou
    Hi,

    Im not totally sure what line feeds are? Do you mean the lines for each unique page? That is what Im trying to get away from but Im not sure how.

    Im not finding it as flexible as I thought it would be.
    {{ DiscussionBoard.errors[8286828].message }}
  • Profile picture of the author RobinInTexas
    Line feed:

    instead of Options -Indexes Options -MultiViews

    Options -Indexes
    Options -MultiViews
    Signature

    Robin



    ...Even if you're on the right track, you'll get run over if you just set there.
    {{ DiscussionBoard.errors[8286862].message }}
    • Profile picture of the author justlukeyou
      Originally Posted by RobinInTexas View Post

      Line feed:

      instead of Options -Indexes Options -MultiViews

      Options -Indexes
      Options -MultiViews
      Im sorry but I dont understand this. I already have this in the code?
      {{ DiscussionBoard.errors[8286872].message }}
      • Profile picture of the author otfromtot
        Originally Posted by justlukeyou View Post

        Im sorry but I dont understand this. I already have this in the code?
        I think he means changing the look. Right now it looks like everything is in one line rather than separate lines.

        like this

        Code:
        a b c d e
        when it should be like this

        Code:
        a
        b
        c
        d
        e
        {{ DiscussionBoard.errors[8296289].message }}
  • Profile picture of the author justlukeyou
    Hi,

    Is there anything I can try as my site is currently down and I cant progress with it.
    {{ DiscussionBoard.errors[8295943].message }}
  • Profile picture of the author justlukeyou
    Hi,

    This is everything. I tried to place it in a code box.

    # Rewrite Rules
    <IfModule mod_rewrite.c>
    RewriteEngine on
    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteCond %{REQUEST_FILENAME} !-d
    RewriteRule ^products/product/([0-9]+)/(.*)$ products/product.php?product_id=$1 [QSA,L]
    RewriteRule ^articles/article/([0-9]+)/(.*)$ articles/article.php?ID=$1 [QSA,L]
    RewriteRule ^articles/articlesfiltered/([A-Za-z]+)/(.*)$ articles/articlesfiltered.php?articlecategory=$1 [QSA,L]
    RewriteRule ^plusstyle/plusstyle/([0-9]+)/(.*)$ plusstyle/plusstyle.php?ID=$1 [QSA,L]
    RewriteRule ^plusstyle/plusstylesfiltered/([A-Za-z]+)/(.*)$ plusstyle/plusstylesfiltered.php?articlecategory=$1 [QSA,L]
    RewriteRule ^([a-z]+)/([a-z\-]+)$ /$1/$2.php [QSA,L]
    </IfModule>
    {{ DiscussionBoard.errors[8296296].message }}

Trending Topics