url-rewriting

How to include special characters in query strings

The following URL works fine: http://localhost/mysite/mypage?param=123 However, if I want to put some special characters in `param like ?, /, \, then the URL becomes: http://localhost/mysite/mypage?param=a=?&b=/ or http://localhost/mysite/mypage?param=http://www.mysite.com/page2?a=\&b=... which won't work. How d...

htaccess mod rewrite changes http://www to http:/www

I want to replace calls like this: www.mysite.com/sub/file.php?param1=x&param2=http://www.someurl.com with: www.mysite.com/sub/param1/param2 Param 1 is an integer number Param 2 is a url I wrote this rewrite rule in htaccess: RewriteCond %{REQUEST_URI} \/sub\/ RewriteRule sub\/([0-9]+)\/(.*)$ sub\/file.php?param1=$2&param2=$1 [L]...

RewriteRule question

Is there any way i can use RewriteRule to show these links: /articles_history.php /articles_geography.php as /articles/history.html /articles/geography.html I created a .htacesss file on my root directory and would like to know if the above is possible by placing some kind of code in the .htaccess file. ...

Subdomain URL Rewriting and Web Apps

So a lot of web apps have the customer choose their own subdomain, ie mycompany.webapp.com Presumably, every subdomain works off the same set of files and the unique subdomain is perhaps stored as a session object. So how does the URL rewriting work? If someone goes to mycompany.webapp.com, you have to rewrite their unique address to a...

User chooses own subdomain, so URL rewriting?

I know we set up the DNS so all subdomains point to our server and configure IIS to respond to every subdomain. I'm looking to know how to rewrite the URL so that each account uses the same set of files and they still browse at that subdomain. Our application isn't written in MVC, so I cant rewrite abc.webapp.com to webapp.com/abc/ At ...

How do you debug php web page that has pretty urls in zend studio?

I've read many tutorials on how to debug php web page like this one, all are very good except that I don't see any of them take into account .htaccess. So these solutions won't work for web pages that have pretty urls. Has anyone figured it out ? ...

website using url-rewriting does not load in Chrome!

I have a PHP page called contact.php, and a rewrite rule in .htaccess RewriteRule ^(.*).html $1\.php [L] that gives contact.php when asked for contact.html. All the pages works (on Firefox and IE), but when I enter on the site with Chrome it loads only the index page and the others don't work at all - I receive a 404 error. I don't t...

Bidirectional URL Rewriting/Redirecting in IIS7.5

First off, I'd like to apologise for the ludicrous title. I'm not trying to sound cool or clever by using the word 'bidirectional', I just genuinely couldn't think of another way to describe it. Promise. On to my problem. I have the following in the <system.webserver>/<rewrite>/<rules> section of my Web.config. <!-- Who We Are --> <rul...

URL Rewriting for user accounts

We currently have domain.com/username redirected to domain.com/setsession.asp?u=username which then redirects to the app at domain.com/theapp. This means users always see domain.com/theapp, so browsing to a page shows domain.com/theapp/somepage.asp Looking to move this to subdomains ie username.domain.com (we'll get the host name a...

Using IIS URL Rewrite, how to rewrite foo.bar.com -> bar.com/myapp

Our web app lies at bar.com/myapp We'll use the HTTP Host Header to work out the username So need to transparently rewrite http://foo.bar.com to http://bar.com/myapp using the URL Rewrite module in IIS But still need to be able to go to www.bar.com and see the company website and webmail.bar.com, etc. ...

How to add a new page in Lift framework

How can I add a new page in the webapp directory in lift that can be accessed by users? Currently only the index.html can be accessed through http://localhost:8080/ or http://localhost:8080/index.html Say I add a static file newpage.html into webapp dir, then what can I do so users can access it through http://localhost:8080/newpage.ht...

need help in htaccess

I need my URL to be like this: http://example.com/index.php?title=about -> http://example.com/about/ The title more than 50, and same goes to pages. Any idea? Thanks ...

Rewrite url for missing resource

For each web request (file or directory) that doesn't start with /en-US/, I want to serve up the original resource if it exists, otherwise serve up the /en-US/ version. How would I do this using rewrite rules in a .htaccess file? ...

Redirect based on Accept-Language

I need to honor the web browser's list of language preferences. Supported languages are English and French. For example: http_accept_language="jp-JP;fr;en-US;en" redirects to a directory called /French/. How can I do this with rewrite rules in my .htaccess file? ...

How to Route URL from one domain to another..

Hello, I am an C# ASP.NET developer. I am trying to route URL from one domain to another using Godaddy IIS Virtual dedicated server or Dedicated server for ASP.NET. For example I have a website application for client_A in my server which is intended to be use by multiple clients with different products. An example URL: www.myserver.c...

url rewriting in php

Hai I have one more doubt in apache mod_rewrite. I want to rewrite the url mydomain/index.php?category=1&id=1 To mydomain/index/category/1/id/1 How I write rule in .htaccess And what is the link that i have to give inside the a tag Please give me a solution.. ...

Wordpress URL Rewriting Ignores Existing Files

I have wordpress installed at the web root directory of a server. I also have a file called test.php in the same directory that is not at all related or connected to wordpress (atleast not by any code within the test.php file). if i go to http://myurl.com/test.php i get my theme's styling and the wordpress error message for when it can't...

WordPress equivalent of Drupal's url()

Is there any WordPress equivalent function for Drupal's url()? ...

Regex issue in rewriter config

I'm having an issue with bad requests from certain search parameters. An example URL: http://www.foo.com/washington/forums/search/%26 Results in a bad request. The rewriter config line looks like this: <rewrite url="^(.*)/forums/search/(.*)" to="~/Pages/Forums/Overview.aspx?Address=$1&amp;q=$2" processing="stop" /> I'm thinking it...

IIS URL Rewriting: How can I reliably keep relative paths when serving multiple files?

My WebApp is part CMS, and when I serve up an HTML page to the user it typically contains relative paths in a.href and img.src attributes. I currently have them accessed by urls like: ~/get-data.aspx/instance/user/page.html -- where instance indicates the particular instance for the report and "user/page.html" is a path created by an ex...