1

I am new to htaccess rules.

I want a rule that will treat two urls as one.

This two should be treated as same URL. I just want to add sites/client1 to URL which actually does nothing. Every URL request should contain sites/client1/.

For next request like

  • multisite2/index.php?id_product=1&controller=product
  • multisite2/sites/client1/index.php?id_product=1&controller=product

Thanks for any help.

1

2 Answers 2

1

Try this:

RewriteRule index.php?(.*) sites/client1/index.php?$1

Also please search around a bit before posting here. Some possible duplicates of this question are these:

.htaccess URL rewrite with one and two query string vars

htaccess url rewrite to .php

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

6 Comments

hi mtndesign, thanks for the help. It is now actually redirecting to sites/client1/index.php. I don't want this i just want to show it in URL. But internally it should stay on domain.com/folder/multisite/index.php Thanks again
sites/client1/ are just dummy parameters
You mean you don't want to redirect the user, you just want to treat the sites/client1/index.php as index.php? Then you should update your question. And as the solution, you should use the mod_proxy. Check apache documentation for this and take look at following questions: q1 q2. If you'll need any code, I can provide it to you.
Oh, I forgot the link to mod_proxy. Here it is.
Have you took a look at the question 1, that I provided to you? That's the code I'm going to post it here.
|
1

This will send all request in /sites/client1/ to /

<IfModule mod_rewrite.c>
RewriteEngine on
RewriteRule ^sites/client1/(.*)$ $1 [L,QSA]
</IfModule>

2 Comments

hi silentboy, thanks for the help. Same issue it is now actually redirecting to / . Simply, /sites/client1/ should remain in URL, but internally it should call domain.com/folder/multisite/index.php
sites/client1/ are just dummy parameters

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.