Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 2 of 2

Thread: mod_rewrite

  1. #1
    Regular Coder
    Join Date
    Oct 2003
    Posts
    603
    Thanks
    2
    Thanked 1 Time in 1 Post

    mod_rewrite

    ok so i moved my site from windows server to linux, but some remote sites link to /directoryname/subdirectory/file.html and some link to /DirectoryName/subdirectory/file.html and i need to have a mod_rewrite condition that will redirect all /directoryname/..... to /DirectoryName/.... and some links have multiple subdirectories and some dont. i cant seem to get it to work.

    Code:
    RewriteEngine on
    RewriteRule ^directoryname$ DirectoryName$

  • #2
    Regular Coder
    Join Date
    Apr 2003
    Location
    Montreal, QC
    Posts
    340
    Thanks
    3
    Thanked 2 Times in 2 Posts
    I'm not an expert but try this:

    Code:
    RewriteRule ^directoryname(/.*)?$ DirectoryName$1$
    You were losing the stuff that came after the directoryname, this should keep it for you.
    Search for Laughter or Just Search?
    GiggleSearch.org
    Blog: www.johnbeales.com
    All About Ballet: www.the-ballet.com


  •  

    Posting Permissions

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