mod_rewrite help

espfutbol98

New Member
Messages
200
Reaction score
2
Points
0
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
 

xav0989

Community Public Relation
Community Support
Messages
4,467
Reaction score
95
Points
0
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.
 

espfutbol98

New Member
Messages
200
Reaction score
2
Points
0
This is what I have now but it's not working:

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