Closed Thread
Results 1 to 7 of 7

Thread: mod_rewrite help

  1. #1
    Junior Member Shemo is an unknown quantity at this point
    Join Date
    Sep 2007
    Posts
    21

    mod_rewrite help

    I'm new to mod_rewrite and am in need of some help......

    I figured most of it out, but I don't have a clue on how to rewrite a url for a subdomain.

    basically, this is what I got so far and it works fine:
    Code:
    RewriteEngine on
    
    RewriteRule ^home$ index.html [L]
    RewriteRule ^gallery$ gallery.html [L]
    RewriteRule ^upload$ upload.html [L]
    RewriteRule ^links$ links.html [L]
    RewriteRule ^support$ support.html [L]
    my sub domains are:
    blog.ugly-cars.com
    gallery.ugly-cars.com


    the gallery.html is already changed to /gallery, but gallery.ugly-cars.com is an iframe within the gallery.html page so it needs to have a rewrite done. the blog sub domain is just a simple word press blog that is its own page.

    any help is appreciated.

  2. #2
    Sup, Recoil here. themoose has a reputation beyond reputethemoose has a reputation beyond reputethemoose has a reputation beyond reputethemoose has a reputation beyond reputethemoose has a reputation beyond reputethemoose has a reputation beyond reputethemoose has a reputation beyond reputethemoose has a reputation beyond reputethemoose has a reputation beyond reputethemoose has a reputation beyond reputethemoose has a reputation beyond repute themoose's Avatar
    Join Date
    Jun 2005
    Location
    Uzbekistan
    Posts
    8,805
    You just put the rewrite rules in a new .htaccess in the subdomain folder rather than the root (or public_html) folder.

  3. #3
    Junior Member Shemo is an unknown quantity at this point
    Join Date
    Sep 2007
    Posts
    21
    Quote Originally Posted by Mentok View Post
    You just put the rewrite rules in a new .htaccess in the subdomain folder rather than the root (or public_html) folder.
    I figured out why my sub domains weren't working-I forgot I had directed my sub domains to a directory that I recently moved my files out of.

    now....

    when you visit this page:
    http://www.ugly-cars.com/gallery

    it should take you to this page:
    http://www.ugly-cars.com/gallery.html

    but it doesn't....it takes you to gallery.ugly-cars.com...any reason why?

  4. #4
    It gets better. Dynash has a brilliant futureDynash has a brilliant futureDynash has a brilliant futureDynash has a brilliant futureDynash has a brilliant futureDynash has a brilliant futureDynash has a brilliant futureDynash has a brilliant futureDynash has a brilliant futureDynash has a brilliant futureDynash has a brilliant future
    Join Date
    Jan 2008
    Location
    United Kingdom
    Posts
    4,531
    http://www.ugly-cars.com/gallery stays the same for me.
    JavaKrypt

    "If you think education is expensive. You should see the cost of ignorance."

  5. #5
    Junior Member Shemo is an unknown quantity at this point
    Join Date
    Sep 2007
    Posts
    21
    Quote Originally Posted by Dynash View Post
    http://www.ugly-cars.com/gallery stays the same for me.
    that redirects to the actual photo gallery and not the gallery.html page that has the gallery embedded into the page with an iframe.

    this is what the page should look like:
    http://www.ugly-cars.com/gallery.html

    I'm not sure why RewriteRule ^gallery$ gallery.html [L]
    would make the page go to entire gallery and not the gallery.html page.

    the rewrite rule works fine on all the other .html files as its supposed to.

  6. #6
    Sup, Recoil here. themoose has a reputation beyond reputethemoose has a reputation beyond reputethemoose has a reputation beyond reputethemoose has a reputation beyond reputethemoose has a reputation beyond reputethemoose has a reputation beyond reputethemoose has a reputation beyond reputethemoose has a reputation beyond reputethemoose has a reputation beyond reputethemoose has a reputation beyond reputethemoose has a reputation beyond repute themoose's Avatar
    Join Date
    Jun 2005
    Location
    Uzbekistan
    Posts
    8,805
    Do you have a folder called /gallery/ ?

  7. #7
    Junior Member Shemo is an unknown quantity at this point
    Join Date
    Sep 2007
    Posts
    21
    Quote Originally Posted by Mentok View Post
    Do you have a folder called /gallery/ ?
    actually, I do..let me try renaming it to something else.

    -that did the trick..thanks all.
    Last edited by Shemo; September 22nd, 2009 at 16:37.

Closed Thread

Similar Threads

  1. mod_rewrite help
    By techguyboy in forum Programming Help
    Replies: 1
    Last Post: March 24th, 2008, 22:09
  2. Need mod_rewrite help...
    By jeffyse in forum Programming Help
    Replies: 2
    Last Post: March 22nd, 2008, 13:43
  3. mod_rewrite rules and php
    By ummec in forum Programming Help
    Replies: 6
    Last Post: January 1st, 2008, 19:57
  4. Server with mod_rewrite
    By nigelwong2 in forum Free hosting requests
    Replies: 3
    Last Post: October 17th, 2005, 09:45
  5. Does anybody know free hosting with mod_rewrite support?
    By animax in forum Free hosting requests
    Replies: 1
    Last Post: November 7th, 2003, 21:14

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