Tag Info

Hot answers tagged


From What are the most commonly used and basic Apache htaccess redirects? contributed by bybe: Catch all and redirect non-www to www You should opt to use mod_write for redirecting all requests for non www versions of your site because the $1 varible will catch page names, so example.com/page1/ will automaticly redirect to www.example.com/page1/. ...


Should I still have dummy, low bandwidth (ie. 1px x 1px) .png files residing on the server under the names img1.png, img2.png, img3.png, even though the redirect means they will never actually be served on the page? No, these would serve no purpose, since your rewrite rules will always intercept requests to those URLs. Your solution, whilst ...


You need to use the QSA flag on your rewrite rule. It preserves any query string from the original URL and appends it to the new URL. Your rewrite rule would be: RewriteRule ^(|/)$ index.php?url=$1 [QSA] RewriteRule ^([a-zA-Z0-9_-]+)(|/)$ index.php?url=$1 [QSA]


Try <IfModule mod_rewrite.c> RewriteEngine On RewriteBase / RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{REQUEST_FILENAME} !-d RewriteRule ^(.*)$ /gallery/$1 [L] </IfModule>

Only top voted, non community-wiki answers of a minimum length are eligible