0

I need to redirect rule for the following condition,

http://domain.com/go/usid/1/testeracc/newacc

to

http://domain.com/trk/link.php?uid=usid&page=1&test=testeracc&new=newacc

I have directory created - domain.com/go/

I don't have any further directories

/usid/1/testeracc/newacc (those will generated dynamically)

Also let me know where I have to put .htaccess file in this process. is it in domain.com/go/ ?

Thank You

3 Answers 3

2

Put this code in your document/go directory's .htaccess

<IfModule mod_rewrite.c>
RewriteEngine on
Redirect /go/ /trk/link.php?url=
</IfModule>

If u visit any site for example http://domain.com/go/usid/1/testeracc/newacc

You will get an array in the following manner

Array
(
     [url] => usid/1/testeracc/newacc
)

grab that and use where ever you want..

Sign up to request clarification or add additional context in comments.

1 Comment

Thank User - user1777091
0

Enable mod_rewrite and .htaccess through httpd.conf and then put this code in your DOCUMENT_ROOT/.htaccess file:

Options +FollowSymLinks -MultiViews
# Turn mod_rewrite on
RewriteEngine On
RewriteBase /

RewriteRule ^go/([^/]+)/([^/]+)/([^/]+)/([^/]+)/?$ /trk/link.php?uid=$1&page=$2&test=$3&new=$4 [L,QSA,NC]

1 Comment

How do I enable "httpd.conf" or How do I know it already enabled or not. ?
0
<IfModule mod_rewrite.c>
RewriteEngine on
RewriteRule ^go/userid/([0-9]+)/([^/]+)/([^/]+) /trk/link.php?uid=$1&page=1&test=$2&new=$3
</IfModule>

Put you .htaccess at your project root.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.