top button
Flag Notify
    Connect to us
      Site Registration

Site Registration

RewriteCond to select by username on Fedora/Apache

+2 votes
380 views

On my fedora 16 box using httpd.x86_64 2.2.21-1.fc16, using SSL,

I tried:

 ...
 RewriteCond %{REMOTE_USER} ^mike$
 RewriteRule 
 ...

and variations thereof.

My intention is to have the RewriteRule run iff "mike" is logged on. It didn't work.

posted Jul 13, 2013 by anonymous

Looking for an answer?  Promote on:
Facebook Share Button Twitter Share Button LinkedIn Share Button
Check out the Look-ahead examples in the manual.
Following this suggestion, I tried:
     RewriteCond %{LA-U:REMOTE_USER} ^mike$
and a few related things. It still fails.

Similar Questions
+1 vote

I use apache 2.4 on centos.

I want to protect the access to a page (/my_folder/secure) with a cookie (in my exemple the cookie name is : my_cookie_name)

I would like that some machine with IP 192.1.1.10 and 192.1.1.11 can access the server without the cookie. This two IP address don't need to have the cookie for access to /my_folder/secure)

And all other IP address are redirect to address https://my_register_site.com if they don't have the cookie.

How to write this ? Some example, and of course it does not work.

Session On 
RewriteEngine on 
RewriteCond %{HTTP_COOKIE} !my_cookie_name 
RewriteCond %{REMOTE_ADDR} !^192.1.1.10$ 
RewriteCond %{REMOTE_ADDR} !^192.1.1.11$ 
RewriteRule ^(.*)$ https://my_register_site.com [NC,L,R=301] 
0 votes

About installing the plugin of the Adobe Flash Player for Firefox,I know the file of libflashplayer.so should be copied to /usr/lib64/mozilla/plugin.By Terminal,after I input the command of sudo cp libflashplayer.so /usr/lib64/mozilla/plugins,the result is username is not in sudoers folder,this will be reported? What should I do ?

+3 votes

I want RewriteCond to match only requests that start with a text from rewriteMap file.

I did this but it only works as an exactly match.
RewriteMap robots_page txt:/etc/robots_page.txt
RewriteCond ${robots_page:%{REQUEST_URI}|NOT_FOUND} !=NOT_FOUND
robots_page.txt contents:/rest-api/ -/rest-apiv2/ -/rest-apiv3/ -

For instance, I want to match requests like:/rest-api/customer/1/rest-api/invoice/2/rest-api/customer/list/rest-apiv2/invoice/98/rest-apiv3/invoice/list

+1 vote

So I wanted to remove libimobiledevices since I *though* I was the one who'd installed it and it was no longer needed (I'm ditching the iPod).

I typed
sudo yum remove blahblah

where blahblah was the actual package name for libimobiledevices.

All of a sudden, I saw it removing all sorts of stuff I didn't want to: blueman, banshee, empathy, etc. It then dropped me to a terminal screen where it had started blueman again. It stayed there.

Finally, I restarted the computer and it only starts at runlevel 3 (non-graphical mode). I have to log in and type startx every time to bring up the desktop. BUT, it only automatically starts GNOME3 and not
XFCE. I also have no way to select XFCE as I no longer get the login screen in graphical mode. It just starts the desktop.

How can I fix this? Did I just do something that will require me to reinstall my system?

Oh, I also tried to do

sudo yum install libimobiledevices and it told me that it was already installed.

+1 vote

Will the rewrite module respect the order of the rules in the config file and execute the rules in order?

...