url-rewriting

How is WordPress' .htaccess and SEO built?

I have thought about using WordPress – or maybe just copy a few functions to a internal site – but before I'd use it I would like to know how it's working. I'm thinking that WP is a bunch of slamcode so I'm hoping some of you could help me on how it's built. How is the .htaccess and URL rewrite combined with index.php? - The .htaccess ...

Using mod rewrite to change URL with username variable

How do I change the following client-side URL domain.com/profile/jung domain.com/jung (preferable) to a server-side URL of domain.com/profile.php?user_id=100 with the username in a php variable? I know I need to edit my htaccess file with a RewriteCond and RewriteRule but it's still not clear to me... How does Twitter manage thei...

Removing index.php from website URLs

I am using the Kohana framework (but I think it's irrelevant for this question) and pages can be accessed like so http://www.example.com/articles/ http://www.example.com/index.php/articles/ Now, as a rule of thumb, I generally try and tweak my .htaccess to only allow one way in for a page, and silently redirect other common ways. Ess...

.htaccess Edge Case

I am using these rules and conditions in .htaccess to turn these http://www.example.com/index.php/about/history http://www.example.com/about/history/index.php into http://www.example.com/about/history .htaccess # ensure there is no /index.php in the address bar RewriteCond %{THE_REQUEST} ^[A-Z]{3,9}\ /.*index\.php\ HTTP/ R...

ASP.NET :URL masking

I have an ASP.NET web application where i have a page Signup.aspx and a home page.aspx.In my home page i have link to the signup.aspx page.I want to Hide the file extension.aspx from the addressbar when someone clicks on the signup link in home page.I want to show it as http://mysite.com/signup . Is there anyway to do this ? I am using ...

How to defer to the "default" HttpHandler for ASP.NET MVC after handling a potential override?

I need to implement a custom handler for MVC that gives me the first look at URLs requests to determine if it should rewrite the urls before submitting the URL to the routing engine. Any pattern is a candidate for the redirect, so I need to intercept the URL request before the standard MVC routing engine takes a look at it. After looki...

is there a PHP library that handles URL parameters adding, removing, or replacing?

when we add a param to the URL $redirectURL = $printPageURL . "?mode=1"; it works if $printPageURL is "http://www.somesite.com/print.php", but if $printPageURL is changed in the global file to "http://www.somesite.com/print.php?newUser=1", then the URL becomes badly formed. If the project has 300 files and there are 30 files that appe...

ASP.NET - Url Rewriting vs. Routing

Hi, I am making a making a new asp.net web forms site and would like to beautify my urls - I want to accept a url like this one "www.mysite.com/1-2,3" and turn it one like this "www.mysite.com/page.aspx?a=1&b=2&c=3". Which option is best for this task - IIS7 Url Rewriting or Routing in terms of performance and ease of maintenance. Btw I ...

PHP clean urls without access to apache configurations

Hi to all, I'm aware of all the canonical ways of getting clean URLs (www.mysite.com/getarticle?a=123 vs www.mysite.com/getarticle/123). Those solutions include mod_rewrite, force_type and various configurations of apache, mostly. Since I don't have access to such config on my shared hosting, is there any solution / hack to work around...

PHP / Zend Mechanisms for Rewriting

Hey there, this is a newbie Zend question. Under a site location: “mydomain.org/subA/subB”, if we go to this location without logging in (or having a session), it i) redirects to a login page. Otherwise, it ii) redirects to a race registration form. Now, I’d thought that Apache rewrite rules did that, but there’s not config that indicate...

How can I store my Rewrite Rules in a database?

Hey everyone, Im developing a new site, and I'd like to store my rewrite rules in a database, instead of right in the .htaccess files. I have another site that uses Opensef (http://sourceforge.net/projects/opensef/) with a Joomla! installation that is doing this, but im not even 100% how it works underneath the hood. How can I store t...

Routing vs Url Rewrite (IIS7) Performance

I was wondering is there any difference in terms of performance between the two approaches? Any good articles on this? ...

Problem using URL rewrite (Relative Paths not working)

Hi I am using a .htccess file in order to rewrite my URLs. I am using the following rules in my .htaccess files Options +FollowSymlinks RewriteEngine on RewriteBase / RewriteRule ^product/([0-9]+)/([A-Za-z0-9+]+)$ /product.php?productid=$1&prodname=$2 The rewrite worked fine. But when i try to access any other page through relative...

Using Forms Authentication/Authorization with Rewritten URLs

I'm doing a quick sandbox test with some Rewritten URLs (example taken from Scott Guthrie's blog) and Forms Authentication / Authorization. I've a very simple setup. ~/View/(\d{1,6}) => ~/Public/View.aspx?ContentID=$1 AND ~/Buy/(\d{1,6}) => ~/Private/Purchase.aspx?ContentID=$1 I've confirmed the URL Rewriting...

Apache URL Rewriting,

Hey folks, I am trying to get URL rewriting to work on my website. Here is the contents of my .htaccess: RewriteEngine On RewriteRule ^blog/?$ index.php?page=blog [L] RewriteRule ^about/?$ index.php?page=about [L] RewriteRule ^portfolio/?$ index.php?page=portfolio [L] #RewriteRule ^.*$ index.php?page=blog [L] Now the 3 uncommented re...

Page anchor with mod_rewrite?

I'm trying to set up page anchors on a website that uses mod_rewrite (Apache2 running on Ubuntu Server 9.04). My htaccess file looks like this: RewriteEngine On RewriteRule ^information.php/([A-Za-z0-9-]+)/?$ information.php?display=$1 [NC,NE] If I was using regular URL's the query would look something like this: http://mydomain/info...

ASP.Net: HTTP 400 Bad Request error when trying to process http://localhost:5957/http://yahoo.com

I'm trying to create something similar to the diggbar : http://digg.com/http://cnn.com I'm using Visual Studio 2010 and Asp Development server. However, I can't get the ASP dev server to handle the request because it contains "http:" in the path. I've tried to create an HTTPModule to rewrite the URL in the BeginRequest , but the eve...

mod_rewrite for any number of variables

I am a newbie to mod_rewrite and I was wondering if there is any way you could make on rewrite script that handles and number of variables you throw at it. Example: www.krisnicolaou.com/index.php?id=5&sort=asc&limit=25&param=first_name to www.krisnicolaou.com/5/asc/25/first_name ...but, you can also pass these variables in on another ...

Url rewriting in asp.net web forms (with some complications)

When it comes to URL Rewriting there are some alternatives these days like the IIS7 module or Urlrewriter.NET. However, as far as I can see those two are based on wildcards which I sadly cannot use. My problem is that the data I'm working with have no real structure. A made up example: Something.aspx?page=4 might be /Weapons/Flails/ So...

How do I redirect this url pattern in asp.net webforms or asp.net mvc?

I am trying to redirect a user when they entire a URL in this format: http://example.com/http://example2.com/ To the following: http://example.com/?m=example2.com#http%3A%2F%2Fwww.example2.com%2F I want to strip out the host of example2 and make it a query-string, then URL encode the full URL of example2 and put it as the anchor. ...