.htaccess rewritecond rewrite case level 2 folder=info


.htaccess rewritecond rewrite case level 2 folder=info



I wanted to set .htaccess to rewrite:

example.com/bla/info/ 

to

example.com/info/index.php?q=bla  example.com/bla/info/txt/ 

to

example.com/info/index.php?q=bla&t=txt 

I wanted the browser still to display:

example.com/bla/info/txt/ 

I didn't want rewrite in the level 2 rewrites, like:

example.com/bla/xxx/  

or

example.com/ccc/zzz/aaa/ 

but

example.com/silly/info/  

would work as well as

example.com/strange/info/mytxt/ 

Did this make sense?

Any help?




htaccess help needed

1:



htaacces redirect
If you start your pattern with ^ and end it with $, the rule will only apply if the whole string matches..
Simple mod_rewrite and website dir structure
RewriteRule   ^/bla/info/$      /info/index.php?q=bla RewriteRule   ^/bla/info/txt/$  /info/index.php?q=bla&t=txt 
If you use do not use the [R] option, the URL shown in the browser will be whatever the user entered..
numeric RewriteRule with .htaccess
Are you trying to make this general-purpose? If so, you can use regex-type matching and variable substitution.


Apache URL rewrite - Trying to mask the folder name
To make 'bla' match any string up to the next slash (/), use .
CakePHP .htaccess mod_rewrite configuration to exclude a particular folder/url
([^/]+) 
in your pattern and reference it with $1 in your substitution..
Magento; dispatch multi store
RewriteRule ^/([^/]+)/info/$          /info/index.php?q=$1 RewriteRule ^/([^/]+)/info/([^/]+)/$  /info/index.php?q=$1&t=$2 
I recommend the Apache web pages about mod_rewrite for more information..
Problems with htaccess ReWrite rule in a top level domain
[Edit.

Fixed the rules to not include the host name in the pattern, as the original poster figured out.]. --
bmb.


2:


you got me in the right track.. i ended up with something like this:.
RewriteRule ^([^/\.]+)/info/?$ example/info/index.php?q=$1 [L] 
thanks a lot.



99 out of 100 based on 59 user ratings 759 reviews