+ Reply to Thread
Results 1 to 3 of 3

Thread: mod_rewrite help

  1. #1
    espfutbol98's Avatar
    espfutbol98 is offline x10 Sophmore espfutbol98 is an unknown quantity at this point
    Join Date
    Apr 2009
    Location
    Zagreb... želim
    Posts
    200

    Question mod_rewrite help

    I've recently started implementing url rewriting in my site and I have ran into a problem:

    First of all, I'm trying to rewrite http(s)://podaci.selfip.net/hr/moj_račun to http(s)://podaci.selfip.net/hr/[user_name]/moj_račun but it looks for all the linked files under the username's folder. I don't want to write exact urls because I don't want to force the use (or lack of use) of ssl.

    What I have in .htaccess is:
    Code:
    order allow,deny
    Allow from all
    Options -Indexes
    DirectoryIndex naslovnica
    RewriteEngine on
    RewriteRule ^naslovnica$ naslovnica.php
    RewriteRule ^moj_račun user_personal.php
    RewriteRule ^([^/\.]+)/moj_račun$ ../hr/moj_račun?name=$1

  2. #2
    xav0989's Avatar
    xav0989 is offline Community Public Relation xav0989 is just really nice
    Join Date
    Jul 2008
    Location
    ifk
    Posts
    4,438

    Re: mod_rewrite help

    you forgot the hr part in the URL in the regex part.
    Also, to check if a redirection is effective, add the [R] flag to make the redirection apparent to the user. This will force the browser to redirect to the other page and you will be able to see if the redirection works.
    Xavier L | Community Public Relations Manager (Free Hosting Support)
    █ Yes, my position is too cool to even exist!
    How am I helping? Rate this post by clicking the icon below! (this is even better than "liking" a post)
    Terms of Service | Acceptable Use Policy | x10Hosting Wiki

  3. #3
    espfutbol98's Avatar
    espfutbol98 is offline x10 Sophmore espfutbol98 is an unknown quantity at this point
    Join Date
    Apr 2009
    Location
    Zagreb... želim
    Posts
    200

    Re: mod_rewrite help

    This is what I have now but it's not working:

    RewriteRule ^/hr/([^/\.]+)/moj_račun$ /hr/moj_račun?name=$1 [R]

+ Reply to Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
x10hosting free hosting for the masses
dedicated servers