url-rewriting

Rewrite for an empty query string

Hi all, I'm building in some caching to one of my sites, and I can't seem to find if there's a way to add a condition with mod_rewrite to apply only if the query string on a request is empty. For example, I'd love to know if I can have a request with no query string like http://www.example.com/ load the page at http://www.example...

problems working with 'rewrite' in apache2

I have the following list of URLs to rewrite: 1 write url /products/client/ send to /basedir/system/index.php?client=cliente 2 write url /product/client/index.php send to /basedir/system/index.php?client=cliente 3 write url /products/client/image/dir2/myimage.jpg send to /basedir/system/image/client/dir2/myimage.jpg 4 ...

URL rewriting for different protocols in .htaccess

Hello. I need help with url-rewriting in .htaccess. So the issue is about different protocols: https and http. The main purpose of rewriting is to remove "www" from URL, but protocol should stay the same it was before. For example, when I have URL like http://www.domain.com/request, it should be redirected to the http://domain.com/req...

Question mark in url (Apache)

Hello, I have a problem with a question mark in url. For example I have url "test.com/controller/action/part_1%3Fpart_2" (where %3F is url encoded question mark). With this rewrite rule "RewriteRule .* index.php/$0 [PT]" it should be passed to framework I use (Kohana) as is. At least I thought so. The problem is that everything after th...

mod_rewrite - friendly URLs and removing page extension

I need a little help with some mod_rewrite rules I am trying to use. I need to do 2 things Change a dynamic URL so that it’s friendly (e.g. /content.php?CategoryID=1 change to /categories/1/) Remove the .php extension on my pages (e.g. /page2.php to /page2) Ok so I can get number 1 to work by itself with the following in my .htacces...

Web service URL rewrite on Godaddy Linux account

I have a Godaddy shared Linux hosting account. I assume that for this issue I'll need to rewrite URLs, but my Apache knowledge is quite limited, so please excuse me in advance if the question is too noob-ish :). for domain xxx.com, I call my PHP web service like this: http://service.xxx.com/catalog.php?action=getcatalog&catalogid=7...

URL Rewriting in visual studio c#

Hi, I have a couple of questions with regards to implementing URL Rewriting in Visual Studio 2008 I am currently using Intelligencia.UrlRewriter to implement URL rewriting in CS 2008. However the rewrite rules are a little different as compared to the IIS7 rewrite rules.Is there a way we can use the same rules while debugging in VS200...

URL rewrite in .htaccess file

Hi all, I have two problems in my current .htaccess. The script below works but has a limitation RewriteRule ^products/([0-9])$ /products/$1/ [R] RewriteRule ^products/([0-9])/$ /viewad.php?adid=$1 Limitation: if adid, is more than 10. it fails. I want it to have whatever number still there and work. my current solution was to add...

Rewriting an arbitrary number of path segments to query parameters

Hi all, I have this .htaccess rule: RewriteRule viewshoplatest/(.*)/(.*)/(.*)/(.*)/(.*)/(.*)/(.*)/(.*)/(.*)/(.*)/(.*)/(.*)/(.*)/(.*)/(.*)/(.*)/$ /viewshoplatest.php?$1=$2&$3=$4&$5=$6&$7=$8&$9=$10&$11=$12&$13=$14&$15=$16 It should map a URL like this: http://www.veepiz.com/viewshoplatest/start/10/end/10/filter/0/ownerid/0/sortby/date...

How to rewrite urls like this ?

How would I rewrite ( for every posts in my blog ): http://localhost/post.php?id=13 to http://localhost/this-is-the-title-of-the-post/13 AND ( without id ) http://localhost/post.php?id=13 to http://localhost/this-is-the-title-of-the-post/ ...

How to rewrite /foo-bar to foo-bar.html but /foo/bar to foo-bar.html using mod_rewrite?

How to rewrite /foo-bar to foo-bar.html but /foo/bar to foo--bar.html using mod_rewrite? In other words, replace all slashes in the request URI with --, then append .html. I wrote the following code: RewriteEngine On RewriteBase / # Take care of /foo/bar and /foo-foo/bar-bar RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{REQUEST_F...

Dynamic URL Rewriting in ASP.net C#

Hey Guys, I am looking to dynamically rewrite urls in asp.net C#. I want to read the page name from the database and process the request. For example PAGENAME: Home .NETPAGE: Default.aspx?page=1 I think it is possible, can someone point me to right direction. ...

url rewrite on sun web server 7

Hi, I am developing a php application with Kohana framework which enables url rewriting by default. I need to translate these rules defined in the htaccess file but I can't figure it out. # Turn on URL rewriting RewriteEngine On # Installation directory RewriteBase /kohana/ # Protect hidden files from being viewed <Files .*> Order...

Help with dynamic RewriteRule in .htaccess

Hi, I would like to use RewriteRules in .htaccess to achieve particular url rewriting, but can't get it right, can somoene help? I'm trying to rewrite the path (everything between the first and last /) into one query string, and the filename into another e.g: http://domain.com/users/admins/testuser.html rewrites to http://domain.com/...

How to rewrite url with IIS7 Rewriter and question mark

I have an url like this : mydomain/page?param1=1 and I want rewrite this to : mydomain/page2?param1=1 <rule name="MyRule" stopProcessing="true"> <match url="page?(.*)" /> <action type="Redirect" url="page2?{R:1}" /> </rule> or <rule name="MyRule" stopProcessing="true"> <match url="page\?(.*)" /> <action ty...

How should IIS7 authentication work with the URL rewrite module?

I am attempting to set up Url Rewriting in IIS7 using its Url Rewrite module, but have been unable to find any documentation on how this interacts with the authentication module (excepting that http://msdn.microsoft.com/en-us/library/ms972974.aspx tells me I can't use digest authentication). When setting authentication (for example, win...

How can I convert this Apache Rewrite rule into a Tuckey UrlRewriteFilter Rule?

I have the following Apache Rewrite rule <IfModule rewrite_module> RewriteEngine on RewriteMap tolowercase int:tolower RewriteCond $2 [A-Z] RewriteRule ^(.*)/(.*).html$ $1/${tolowercase:$2}.html [R=301,L] </IfModule> that changes this: http://localhost.localdomain.com/FooBarBaz.html to this: http://localhost....

Url Rewriting in asp.net but maintaining the original url

Page aspxHandler = (Page)PageParser.GetCompiledPageInstance(virtualPath, context.Server.MapPath(virtualPath), context); aspxHandler.PreRenderComplete += AspxPage_PreRenderComplete; aspxHandler.ProcessRequest(context); When you call Page.Request.Url after this, you get the Url of the page you rewrote to ...what I'm looking for is to d...

apache htaccess redirect many url to one

Sorry guys if this is a lame question, but the examples i found dont quite work the way I want What I'm tryint to achive is send any web site request for products to "producto.php" but keeping the descriptive URL for the search engines. This is the .htaccess I have RewriteRule ^en/products(/)?$ /en/products/tactical/ [R] RewriteRule ...

Remove multiple forward slashes in URL

I'm trying to remove unwanted additional forward slashes in my URLs. For example: "http://www.domain.com//" and "http://www.domain.com///" should redirect to: "http://www.domain.com" I'm using the IIS URL rewrite module. Here is what I have so far: <rule name="RedirectForwardSlash" stopProcessing="true"> <match url="//+$" /> ...