How to Block an IP address range using the .htaccess file
You could use: Order Allow,Deny Deny from 66.249.74.0/24 Allow from all Or you could use this: RewriteEngine on RewriteCond %{REMOTE_ADDR} ^66\.249\.74\. RewriteRule ^ – [F]
You could use: Order Allow,Deny Deny from 66.249.74.0/24 Allow from all Or you could use this: RewriteEngine on RewriteCond %{REMOTE_ADDR} ^66\.249\.74\. RewriteRule ^ – [F]
Try this rule: RewriteRule ^profile/([^/]+)$ profile.php?user_name=$1 This will rewrite requests of /profile/foobar to /profile.php?user_name=foobar. Note that you just can rewrite the user name. You script will then have to look up the user ID if necessary.
RewriteEngine ON RewriteRule ^/.+ / [L,R] That will redirect everything to / as a permanent redirect. Look at http://httpd.apache.org/docs/2.0/mod/mod_rewrite.html for more information on the flags you can add for transparency etc etc. If you want this in .htaccess make sure you have the correct override directives in your <VirtualHost > config.
Try this: RewriteCond %{THE_REQUEST} ^GET\ /[^?\s]+\.php RewriteRule (.*)\.php$ /$1/ [L,R=301] RewriteRule (.*)/$ $1.php [L] The first rule redirects requests of /foo/bar.php externally to /foo/bar/. And the second rule rewrites requests of /foo/bar/ internally to /foo/bar.php. And to force the trailing slash, try this rule: RewriteCond %{REQUEST_FILENAME}.php -f RewriteRule .*[^/]$ $0/ [L,R=301]
You could use a rewrite rule with a query string match condition, such as: RewriteEngine On RewriteCond %{REQUEST_URI} ^/index.php$ RewriteCond %{QUERY_STRING} ^page=news&id=2366$ RewriteRule ^(.*)$ http://www.example2.com/news.php?name=23546 [R=301,L] Checkout this blog page for more information on how this works.
Redirect 301 /Blog /blog Or use something like http://www.htaccessredirect.net/index.php
You have to treat the rules separately. All Conditions preceding rules only apply to a single, immediately following rule. You tried to ‘chain’ two rules. The second rule never could have matched, since the first one was a catch-all that changed the syntax. Apart from that you have to make sure that the first rule … Read more
This is what I ended up doing : Options +FollowSymLinks RewriteEngine on RewriteCond %{REQUEST_URI} !(.*)folder RewriteRule ^(.*)$ folder/$1 [L]
In your system/application/config/config.php, change $config[‘index_page’] = “index.php”; to $config[‘index_page’] = “”; and in your .htaccess, add this: RewriteEngine on RewriteCond $1 !^(index\.php|images|stylesheets|scripts|robots\.txt) RewriteRule ^(.*)$ /index.php/$1 [L] Add your .htaccess file to the same directory where the system folder is located, so in your CodeIgniter root directory, you should have system/ user_guide/ index.php .htaccess license.txt Also, … Read more
If you are using the R flag you are telling mod_rewrite that an external redirect is what you want, therefore the browser is asked to make a new request and the address bar should change accordingly. Without the R flag, there is no redirect, but an Apache-internal request rewrite which is hidden from the browser. … Read more