url-rewriting

Mod_rewrite not working properly

I have this in my .htaccess file... RewriteEngine on RewriteRule ^/invite$ /invite.html It's meant to let a user access this url: http://mysite.com/invite and display the invite.html page. I don't want to redirect the user, but just show them the invite.html page from a better looking URL. When I browse to http://mysite.com/invite...

How to normalize a URL in Java?

URL normalization (or URL canonicalization) is the process by which URLs are modified and standardized in a consistent manner. The goal of the normalization process is to transform a URL into a normalized or canonical URL so it is possible to determine if two syntactically different URLs are equivalent. Strategies include adding tr...

after .htaccess url rewrite, cannot perform logoff in some of the url rewrited page

Recently, I was doing .htaccess url rewrite, make all my php url into html, in some page, the logout button wont work properly. for example, in page ‘quotedetails/Q9999.html’ (rewrited from ‘quotedetails.php?quoteID=Q9999′), when I click logout button in this page, it wont do the trick, but when i use the old php url of this page, it wor...

Getting text after URL in asp.net / URL Rewriting (sort of!)

My app is a very simple "one page" type app- It has Default.aspx I'm basically trying to get, for example: www.myappurl.com/this is my text I want to get hold of "this is my text" from the above example. This will be displayed on the page (for now) I didn't really want to have to use any complext url rewriting things for this... (My h...

url rewrite, login problem in particular pages, no response headers

Recently, I was doing .htaccess url rewrite, make all my php url into html, in some page, the logout button wont work properly. for example, in page ‘quotedetails/Q9999.html’ (rewrited from ‘quotedetails.php?quoteID=Q9999′), when I click logout button in this page, it wont do the trick, but when i use the old php url of this page, it wor...

Rewriting URLs with mod_rewrite

Hey guys, I'm currently rewriting urls from http://domain.com/profile/?u=10000017564881 this to this http://domain.com/profile/10000017564881 with the following rewrite RewriteEngine On RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{REQUEST_FILENAME} !-d RewriteRule ^(.*?)\/?$ index.php?u=$1 [L] However I'd like to optimiz...

.htaccess rewrite rule to add a string in the middle of the URL

Using a .htaccess rewrite rule, I need to add "?q=" before the path on any URL's containing the word "imagecache" Therefore, if the URL is: http://mysite.com/sites/default/files/imagecache/myimage.jpg ...then it will really try: http://mysite.com/?q=sites/default/files/imagecache/myimage.jpg But that will ONLY happen if the URL c...

I'm Stuck with a simple lighttpd url.rewrite

Hello, Just switched from apache and having some rewrite issues. Simple task: rewrite "http://www.foo.com/BAR/" to "http://www.foo.com/BAR/index.php" I've tried the following (and variations) but it doesn't parse. url.rewrite = ( "/BAR/" => "/BAR/index.php" ) I suck in regexps btw. ...

Strip part of the URL for every request - Apache

Hi, this is the first bit of apache rewriting I've done, so hopefully it's an easy one for the experts out there. I have a website which for this example would have 3 pages: www.example.com/appname/page1 www.example.com/appname/page2 www.example.com/appname/page3 I want to hide the appname from the person browsing the site for every ...

Site URLs using a PHP "pretty url" framework

I have been experimenting with the lightweight NiceDog PHP routing framework, which routes like this: R('entries/(?<id>\d+)') ->controller('Entries_Controller') ->action('show') ->on('GET') Now the .htaccess file is set up to do this redirect like so: RewriteEngine On RewriteCond %{REQUEST_FILENAME} !-d RewriteCond %{REQUEST_FI...

htaccess remove .php extension, index.php AND add trailing slash

This is for basic HTML/PHP pages, no query strings, etc.. I have searched high and low and find resources for removing the 'index.php' from the URI, or removing '.php' and other file extensions.. and even adding a trailing slash. But, everytime I try to use them all, or use examples that I have found, I get a 500 server error. I may pas...

How to replace 'dash' with 'underscore' in an IIRF rule?

I have a web app which serves images based on the subdomain. We wanted to provide our users with a url like this: http://{username}.domain.com/images/myimage.jpg Instead of what we used to have: http://www.reallylongdomainname.com/users/{username}/images/myimage.jpg This makes the url shorter and less 'snoopable'. So I set up an IIRF...

String Functions in IIS Url Rewrite Module

The IIS URL Rewrite Module ships with 3 built-in functions: * ToLower - returns the input string converted to lower case. * UrlEncode - returns the input string converted to URL-encoded format. This function can be used if the substitution URL in rewrite rule contains special characters (for example non-ASCII or URI-unsafe characters). ...

.htacces to create friendly URLs. Help needed....

Hi, I'm having a hard time with .htacces. I want to create friendly URLs for a site I'm working on... Basically I want to convert this: http://website.com/index.php?ctrl=pelicula&amp;id=0221889 http://website.com/index.php?ctrl=pelicula&amp;id=0160399&amp;tab=posters Into this: http://website.com/pelicula/0221889/ http://website.com...

Paging not working in my wordpress installation

I recently started a blog site and wanted to give it a magazine look. I used Wordpress for my blog and used the Arthemia theme with it. I also changed the permalink structure to point to /%year%/%monthnum%/%day%/%postname%/ structure. Now the problem that i have is that the paging has stopped working on my home page. When i click on the ...

IIS URL Rewrite rule - Default document for subdirectories

I would like create URL rewrite rule that will set default document for my virtual folders. eg. someting like this www.domain.com/en/ -> www.domain.com/en/index.aspx www.domain.com/hr/ -> www.domain.com/hr/index.aspx www.domain.com/de/ -> www.domain.com/de/index.aspx directories en, hr, de doesn't really exists on web server they are...

Passing URIs as URL arguments in Drupal 6

I'm running into problems trying to pass absolute URIs as parameters with clean URLs enabled. I've got hook_menu() set up like this: function mymodule_menu() { return array( 'page/%' => array( 'title' => 'DBpedia Display Test', 'page callback' => 'mymodule_dbpedia_display', 'page arguments' => array(1), ), ...

Can I rewrite the whole url?

I need to rewrite the whole url. E.g. I have a http://UrlToRewrite.com/default.aspx?myParams=myvalues and I need it to be http://SingleUrl.com Is it possible to make such a thing with default url rewriters? Another question is, is it possible to make the same thing, but depending on the parameter destination url will be http://SingleUrl1...

Best methods to make urls friendly?

We're working on revising the url structure for some of our movie content, but we aren't quite sure on the best way to handle odd characters. For example, '303/302' '8 1/2 Women' 'Dude, Where's My Car?' '9-1/2 Weeks' So far, we're thinking: /movies/303-302 /movies/8-1-2-women /movies/dude-wheres-my-car /movies/9-1-2-weeks Is this t...

How to prevent redirect loop with ManagedFusion URL Rewriter?

Using ManagedFusion's URL rewriter, I have the following code. When requesting / on the Visual Studio development server, I get a redirect loop, however the same code works on a production IIS server when I upload the site to it... why is this? I have <defaultDocument enabled="false"/> in the web.config. RewriteRule ^/(Default|index|hom...