apache - multiple mod_rewrite clash -


I am trying to work together in 3. Mod_rewrites in an .htaccess file.

I want the following:

School. Mysite.com => mysite.com/index.php?inst=school

mysite.com/french => Mysite.com/subject.php?sub=french

School. Mysite.com/french => mysite.com/subject.php?inst=school&sub=french

I had found two work before but did not get the third task to work for my life. After a week I gave it and asked for help here, fortunately for me, the solution given me very quickly:

  RewriteCond% {REQUEST_FILENAME}! -d RewriteCond% {HTTP_HOST} ^ ([A-zA-Z _] +) \. Mysite \ .com $ [nc] rewrite rule ^ ([a-zA-Z _] +) /? $ Index.php? Inst =% 1 and sub = $ 1 [L, QSA]  

The code is not flawlessly in its errands, but I want the moon on a stick also wants that 2 other still with Work in ... and they do not.

Since then, I am working on non-stop and can get the subject working with the code given below.

  Rewritecond% {REQUEST_FILENAME }! -d rewrite code% {HTTP_HOST} ^ Mysite \ .com $ [NC] Rewrite condom% {REQUEST_URI} ^ / ([a-zA-Z _] +) /? $ Rewrite ^ (. *) $ Subject.php? Sub =% 1 [L] rewrite% {REQUEST_FILENAME}! -d Recovery code% {HTTP_HOST} ^ ([a-zA-Z _] +) \. Mysite \ .com $ [nc] revised rule ^ ([a-zA-Z _] +) /? $ Index.php? Inst =% 1 & amp; Sub = $ 1 [L, QSA]  

But I can not find a sub-domain working with it, my attempt is ...

  Rewrite angle% {REQUEST_FILENAME}! -d Recovery code% {HTTP_HOST} ^ ([a-zA-Z _] +) \. Mysite \ .com $ [nc] recto condom% {REQUEST_URI} ^ $ RewriteRule ^ (. *) $ Index.php? Institute =% 1 [L]  

I thought that the URI was empty, it could be triggered. Instead of hitting my head for another week against the wall, I thought I would ask at the end of the day instead :) If there is a difference then that subdomain check is in the .htaccess file in the order of the subject check and then Combined check

I'm assuming that my argument is somewhat faulty, please help.

Related to

Zen

If you like them If the order is given, then it should work:

  rewrite the line% {REQUEST_FILENAME}! -d Recovery code% {HTTP_HOST} ^ ([A-zA-Z _] +) \. Mysite \ .com $ [NC] rewrite rule ^ ([a-zA-Z _] +) /? $ Subject.php? Inst =% 1 and sub = $ 1 [L, QSA] Revoked% {HTTP_HOST} ^ ([a-zA-Z _] +) \. Mysite \ .com $ [nc] rewrite ^ /? $ Index.php? Inst =% 1 [L, QSA] rewrite% {REQUEST_FILENAME}}! -d Recriminate \% {HTTP_HOST} ^ MySite \. Com $ [nc] rewritable ^ ([a-ga-z_] + / $ theme.fip? Sub: $ 1 [L, QSA]  

First a subdomain and a request Yuri, the second will be a subdomain with a blank Yuri, and the third will be a Yuri's No subdomain with The order of the first two is important, if you want, the third person may be the first.


Comments

Popular posts from this blog

apache - 504 Gateway Time-out The server didn't respond in time. How to fix it? -

c# - .net WebSocket: CloseOutputAsync vs CloseAsync -

c++ - How to properly scale qgroupbox title with stylesheet for high resolution display? -