url-rewriting

apply mod_rewrite in virtual host

Dear all, i would like to rewrite url in virtual host. Virtual directory : htdoc/dev/ , dev.com syntax in .htaccess in htdoc/dev <IfModule mod_rewrite.c> RewriteEngine On RewriteRule test.html$ test.php [L] </IfModule> I am able to rewrite test.html to test.php in localhost. However, not able to do it in virtual host. What went wron...

IIS URL rewriting to redirect querystring addresses to MVC style path to preserve old links

I am trying to preserve old links such as index.php?pageid=123 to the now current /accounts/home. No part of the original URL has to be included in the redirect. I have a big list of old page links and their new address. I thought it would be really simple to say index.php?pageid=123 = /accounts/home but I can't see how to do it. Most o...

url rewriting problem

in my .htaccess file i have the following Options -Indexes RewriteEngine on RewriteCond %{REQUEST_FILENAME} !-f RewriteRule ^(.*)/(.*)$ index.php?lang=$1&id=$2 [L] so when i wrote http://mydomain.com/am/home it will be redirected to http://mydomain.com?lang=am&amp;id=home but i have a cms folder, and i need to go to http://my...

Access GET variables with PHP + .htaccess

I'm developing a website using PHP. My .htaccess has this rewrite rule: RewriteEngine On RewriteRule ^book/([^/]*)\.html$ book.php?title=$1 [L] So the URL that looked like: www.example.com/book.php?title=title-of-the-book turns into www.example.com/book/title-of-the-book.html In a specific case, from another page in the site, I want...

.htaccess URLs: Use File Extension?

When using .htaccess to redefine the URLs for a site, there are two clear options: Provide no extension, as StackOverflow has done with URLs like http://stackoverflow.com/questions/ask Provide the extension of .html, regardless of the underlying technology, so something like http://stackoverflow.com/questions/ask.html Are there any s...

URL Rewriting Problem for a Beginner

I'd like to have all requests to http://example.com/controller redirected to http://example.com/index.php/controller without changing the url, and this is what my .htaccess file looks like: # Customized error messages. ErrorDocument 404 /index.php # Set the default handler. DirectoryIndex index.php # Various rewrite rules. <IfModule m...

Must one use an MVC FrameW to produce clean URL's?

The host that I want to host with does not support server side url rewriting, thus no third party tools can be installed to rewrite the url's. This is Coldfusion 8, on windows, IIS. The other alternative that I know of is to use a framework, but I do not feel like taking that route (time), for the application works well as it is (but t...

scala & lift: advanced url rewriting

Hello, I'm looking for a solution for rewriting urls in lift using list declared outside the scope of LiftRules.statelessRewrite.append LiftRules.statelessRewrite.append { case RewriteRequest(ParsePath("abc" :: Nil, _ , _ , _ ), _ , _ ) => RewriteResponse("index" :: Nil) } I'd like to have the following code working the ...

Trying to hide a part of the url with mod_rewrite

Hi, I'm attempting to hide a part of an url from the address, because it's useless mouse coordinates sent due to input type="image" The URL is: www.example.com/search.html?mode=fulltext&query=HelloWorld&ssubmit.x=0&ssubmit.y=0 I want to hide the ssubmit.x and ssubmit.y part. I tried adding the following rule to .htaccess, but withou...

Request.Url.AbsoluteUri and rewritten URL's.

I need to be able to get the URL as I see it in the browser i.e The rewritten one. For instance: If my Url was www.myurl.com/Test.html and I then used Request.Url.AbsoluteUri, the URL returned would be: www.myurl.com/Default.aspx?Action=Test I need to be able to get back the exact rewritten URL. Does anyone know how I can achieve this...

Create a Global IIS 7 rewrite rule

I have wildcard A records (* and *.*) for my domain pointing to my dev machine. Basically, any subdomain that is not www is pointed to my dev machine (except the root). I never want my dev machine to be index or "followed" by search engines. What I would like to do is simple set up a global URL Rewrite rule like so: <rule name="Global...

UrlProperty and relative URLs

I have a custom UserControl (inherits System.Web.UI.UserControl) with this property, which should be set to a URL on the site that you want to link to: [DefaultValue("~/NewsItem.aspx"), UrlProperty("*.aspx")] public string InternalItemViewUrl { get { return _internalItemViewUrl; } set { _internalItemViewUrl = value; } } The co...

How can I append .html to all my URLs in cakephp?

I am using cakephp in one of my projects and my client wants the site URLs to end with .html and not the usual friendly urls. I was wondering if its possible in cakephp to do so through any of its routing techniques. Please help. ...

Rewrite sub-domain to directory

Hi there, I'd like to map subdomain.example.com to www.example.com/subdomain using an internal URL rewrite that looks at the host name and simply forwards any request to a subdirectory with the same name as the subdomain. Thanks for your help ...

how to disable http_auth on a single zend controller

Hey All, Project which I am currently working is developed using ZF and dojo. For our Development and Production server we have basic user authentication which is handled using apache's virtual host config file (by having users and password files). When we type the server URL, it will pop-up the authentication window. It is working wel...

URL rewritting in asp.net 2.0

Hi All, I am using asp.net 2.0 with C#. My Querystring is like this www.xyz.com\default.aspx?name=steve I want it to be like "www.xyz.com\name\steve\default.aspx" or www.xyz.com\FakeName\name\steve\default.aspx I have found that I can achieve this by URL rewritting but the explanation I found of net is too complex for me, also on the...

How to apply output rules to script tag's content in IIS7 rewrite module v2?

Hi, I want to specify that my output rule should only apply to the contents of a tag... the predefined tags allow me to change the url of the src attribute of the script tag, but I want to change any URLs specified within any snippets of javascript embedded in my page. I've looked at using custom tags for this, but it still seems to b...

URL rewriting apache

I would like to rewrite two urls on my website so as they are more search engine friendly. How can I do this in my .htaccess? For the first I tried this, but got 404 errors: RewriteRule ^research/([0-9][0-9])$ /research/$1/ [R] RewriteRule ^research/([0-9][0-9])/$ /urt.php?func=viewresearch&rid=$1 RewriteRule ^research/([0-9])$ /resea...

asp.net mvc routing to a custom handler instead of controller?

I have a custom handler I've written that executes a custom action based on a parameter, for example: /action/option1 would execute the action handler with option1. I can have any number of options for the parameter... however this action is a custom handler, NOT an mvc controller, because I'm returning a plain text (possibly moving t...

.htaccess - create a language dir

For SEO friendly urls i'm using this expression: RewriteRule ^([0-9]+).([^/]+)$ index.php?id=$1&titel=$2 The url is domain.com/55-page-title and it works perfect. Now i have to determine different languages and my url should look like domain.com/de/55-seitentitel. I've no idea how to rewrite regular expression in .htaccess file. Rew...