Tag Info

New answers tagged

0

First Method : install web platform installer from : http://www.iis.net/downloads after that find the urlrewrite and add to iis, than you can find url rewrite section in iis. You can create new rule or import from .htaacess file via url rewrite. Second and Easy Method : Open iis and select related website, go to errors section and find 404 error. double ...


0

The design pattern you are using is called the "front controller" -- a central entry point for handling requests. Here is a website that shows how to implement that pattern with various webservers. Here is the configuration they recommend for IIS in the web.config file: <?xml version="1.0"?> <configuration> <system.webServer> ...


2

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/. ...


0

The problem is that you have a api directory. The Apache code that handles redirects to add slashes to the directory is happening before the rewrite rule. Move your api directory to something else (like apiscripts) and then use the rewrite rule: RewriteRule ^api$ apiscripts/index.php [L,QSA] You need the flags on the rewrite rule: L (last) -- so ...


1

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 ...


0

You can use the code you have, just use it again with HTTPS_HOST too (more chars escaped with \ even though it may not be needed in most servers). As w3d noted in a comment above, this is designed to work in a htaccess file because of the / before the $1: RewriteCond %{HTTP_HOST} ^domain\.tld$ RewriteRule ^(.*)$ "http\:\/\/www\.domain\.tld\/$1" [R=301,L] ...


0

Try: RewriteEngine on RewriteRule ^(gallery)\/(.+)$ http://website.com/$2 [R=301]


1

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]


1

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



Top 50 recent answers are included