.htaccess

Allow multiple IPs to access Wordpress Site Admin via .htaccess

与世无争的帅哥 提交于 2020-01-04 02:55:47
问题 I currently have a wordpress site that is being upgraded and I have a maintenence redirect setup in the .htaccess file. I can allow my own IP access the site and admin but how can I allow multiple IPs access for the other editors to also have access. I'm currently using : RewriteEngine on RewriteCond %{REMOTE_HOST} !^123.456.789.101 #RewriteCond %{REMOTE_ADDR} !^123.456.789.101 RewriteCond %{REQUEST_URI} !/maintanence.html$ [NC] RewriteCond %{REQUEST_URI} !.(jpe?g?|png|gif) [NC] RewriteRule .

htaccess mod_rewrite hostname

让人想犯罪 __ 提交于 2020-01-04 02:44:26
问题 How can i rewrite the domain url to a specific domain name if it didnt match it .. Let's say i want it to only match example.com and the visitor came from server ip (http://127.0.0.1/something/else) OR came from another domain (http://domain.com/something/else) how can i rewrite the domain name and keep all the other parameters, just domain name to example.com ( result should be : http://example.com/somthing/else ) 回答1: Try adding these rules to the htaccess file in your document root:

htaccess mod_rewrite hostname

拈花ヽ惹草 提交于 2020-01-04 02:44:09
问题 How can i rewrite the domain url to a specific domain name if it didnt match it .. Let's say i want it to only match example.com and the visitor came from server ip (http://127.0.0.1/something/else) OR came from another domain (http://domain.com/something/else) how can i rewrite the domain name and keep all the other parameters, just domain name to example.com ( result should be : http://example.com/somthing/else ) 回答1: Try adding these rules to the htaccess file in your document root:

Rewriting URL and making new URL show in location bar

我只是一个虾纸丫 提交于 2020-01-04 02:43:09
问题 I'm using the below code to rewrite some URL's: RewriteEngine On Options +FollowSymlinks RewriteBase / RewriteRule ^New_Hampshire/[a-zA-Z0-9_+\-\s]*\.html$ NH/ Keep in mind that there is also this rule below that.. RewriteRule ^([a-zA-Z]{2})/ state.php?state=$1 [L] Now, what I am wanting to achieve is if someone goes to for example: www.mydomain.com/New_Hampshire/index.html I want the location bar to show: www.mydomain.com/NH/ Usually I am able to achieve this by using the [R] flag at the end

Nginx: redirect non-www to www on https

我与影子孤独终老i 提交于 2020-01-04 01:31:35
问题 Nginx isn't working to redirect non-www to www if I'm on https : https://domain.com to https://www.domain.com My curent setup in .conf is: server { listen 80; server_name www.domain.com domain.com; return 301 https://www.domain.com$request_uri; } server { listen 443; server_name domain.com; return 301 https://www.domain.com$request_uri; } server { listen IP_ADDRESS:443 ssl; server_name www.domain.com; ... } http://domain.com to https://www.domain.com and http://www.domain to https://www

Nginx: redirect non-www to www on https

白昼怎懂夜的黑 提交于 2020-01-04 01:31:03
问题 Nginx isn't working to redirect non-www to www if I'm on https : https://domain.com to https://www.domain.com My curent setup in .conf is: server { listen 80; server_name www.domain.com domain.com; return 301 https://www.domain.com$request_uri; } server { listen 443; server_name domain.com; return 301 https://www.domain.com$request_uri; } server { listen IP_ADDRESS:443 ssl; server_name www.domain.com; ... } http://domain.com to https://www.domain.com and http://www.domain to https://www

Adding encoded chars to the url breaks htaccess

偶尔善良 提交于 2020-01-04 01:19:21
问题 Here's my code: RewriteEngine on RewriteRule page/(.*) index.php?url=$1 [NC] When I access page/http://google.com/ = works just fine When I access page/http%3A%2F%2Fgoogle.com%2F = server reports 404 Martti Laine 回答1: Apache returns a (somewhat non-intuitive) 404 in cases when you have encoded slashes in the request, but do not have AllowEncodedSlashes set to on. To confirm this is the case, check your error log, which likely contains an entry like this: found %2f (encoded '/') in URI

Redirect subdomain to CakePHP action

♀尐吖头ヾ 提交于 2020-01-03 20:58:08
问题 Background I have a CakePHP application that lives in /m/ . I want to write a root-level .htaccess file which will redirect "subdomains" for the site as parameters to actions. For example: I want to write a rewrite rule which will result in redirects like this - http://mysite.myserver.com → http://myserver.com/m/mysite/ http://mysite.myserver.com/home → http://myserver.com/m/mysite/home http://mysite.myserver.com/foo/bar?baz=true → http://myserver.com/m/mysite/foo/bar?baz=true Ideally, this

htaccess downloading file instead of loading

一笑奈何 提交于 2020-01-03 18:55:12
问题 I would really like my index.html to be able to have a PHP script work on it. I read that you can do this through the htaccess file. I only have access to a subdomain website directory, where I can upload my files through FTP. The directory did not have a htaccess file, so I created one using notepad: .htaccess and added this to the file: AddType application/x-httpd-php .html The problem is, instead of loading the index.html page, it downloads it as a file...would I need to add something

Enable PHP short tags using .htaccess

冷暖自知 提交于 2020-01-03 17:32:06
问题 I have Apache set up on my own Centos server with several virtual web servers, and I wish to enable PHP short tags for only one of those web servers which is located at /var/www/ostickets/html . I can successfully enable short tags by adding short_open_tag=On to php.ini, however, I don't wish to globally do so, but only the one site. I've tried the following, however, nothing is displayed. I've looked at various logs, and cannot detect any errors. Is it possible that I inadvertently disabled