SitePoint Sponsor

User Tag List

Results 1 to 3 of 3
  1. #1
    SitePoint Member
    Join Date
    Jun 2009
    Posts
    2
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    .htaccess mod_rewrite issue (missing css & images)

    Hi guys,

    I'm new to this and I would appreciate some of your expertise :-)

    I'll let you know what I'm trying to do:

    I have a small website with static pages and I just want to remove the extension .php from my files.
    After lots of tries I came up with this

    RewriteRule ^([A-Za-z0-9]+)/?$ $1.php [L]

    That works fine when I type w w w.example.com/company but when I type w w w.example.com/company/ (slash at the end) I loose the css and the images.
    Besides that when I type w w w.example.com/company/about or any other page on a folder other that root, I get a 404 not found page.

    Could anyone help me solve this?

    Thank you in advance :-)

  2. #2
    SitePoint Member
    Join Date
    Jun 2009
    Posts
    2
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    The problem is solved.

    Thx :-)

  3. #3
    Certified Ethical Hacker silver trophybronze trophy dklynn's Avatar
    Join Date
    Feb 2002
    Location
    Auckland
    Posts
    14,653
    Mentioned
    19 Post(s)
    Tagged
    3 Thread(s)
    For others, I called that the "missing support files" problem in my signature's tutorial and is caused by changing the perceived directory level which makes relative links off-target. Read for the two solutions (absolute is already inferred but it's NOT the elegant solution).

    Regards,

    DK
    David K. Lynn - Data Koncepts is a long-time WebHostingBuzz (US/UK)
    Client and (unpaid) WHB Ambassador
    mod_rewrite Tutorial Article (setup, config, test & write
    mod_rewrite regex w/sample code) and Code Generator


Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •