url-rewriting

how do i strip out the WWW in my url using php

so i want to do an external permanant redirect (301) from http://www.creya.com to http://creya.com. i am not using apache but rather, abyss web server and i can't figure out the url rewrite rules. but i believe i could also do this at the app level with php. i think wordpress does do this. i set http://creya.com/blog as your blog url ...

How to 301 redirect

Ok, I need to know how to do a redirect (where to put the code or specify the setting). We're redirecting from one app to another after we've moved the app. So for example, if a user goes to existing.example.com/archive/ we want to redirect any requests that contain old.example.com to new.example.com. The rest in the url stays the sa...

Is "&" character inside url segment allowed?

Is "&" character in url allowed? What is the impact to url if it's illegal and is present. I'm looking for an answer from an SEO standpoint. Example: rootdomain.com/Black&Decker/products ...

mod_rewrite and hyperlinks

Hi Guys, I'm trying to get my head around mod_rewrite and friendly URLS. OK, on a very basic level I have the following rule: RewriteRule ^register$ register.php [L] This allows me to browse to www.mydomain.com/register The hyperlink within my pages shows register.php. Do I have to manually change my links to register? Esentiallly...

Forms authentication + URL Rewriting gives access to secure pages

Hello everyone.. I have a problem with URL rewriting and Forms authentication in ASP.NET... Based on articles I've found on the net, I have created the following HttpModule: public class UrlRewriter : IHttpModule { private UrlRewriteConfigurationSection config; public UrlRewriter() { config = ConfigurationManager.G...

How do you use javascript/jQuery to rewrite amazon affiliate links?

Basically what I want the script to do, is add my affiliate ID to all Amazon links posted by my users.(Kinda what SO is doing, minus the whole redirect/racking thing) Here is the code I'm using, and for some reason it's not working. <script type="text/javascript"> $(document).ready(function() { $('a[href*='amazon.com']').each(...

URL Rewrite 1.1 within VisualStudio 2008

Hi all, I have changed one of my apps to use URL Rewrite 1.1 in IIS7.5 which works great (as some of you my have seen from previous posts) but I have an issue that this doesnt work when developing as Visual Studio Webserver doesnt seem to support it. Is there a way to get it work so we can actually debug it, rather than writing a compl...

.htaccess mod_rewrite - how to exclude directory from rewrite rule

Hello all! I have 8 lines of rewrite rules in my .htaccess file. I need to exclude two physical directories on my server from these rules, so they can become accessible. For now all requests are sent to index.php file. Directories to exclude: "admin" and "user". So http requests: http://www.domain.com/admin/ should not be passed to ...

SQL query's organisation, transforming url into title from db

Hi everyone! I currently have a site with multiple articles being user-generated as content. On each new post, there is a hidden $getcurrentpageurl variable. When a user is reading a post (x), a form button saying "respond to this post" sends the user to a submit form, in which a hidden field catches the posted $getcurrentpageurl, and i...

mod_rewite advice

Hi Guys, I was wondering if you could advise if there is a more efficient way of writing what I have below? Could this be acheived in the 1 rule? RewriteRule ^search/(cars|boats|plant)/([-a-zA-Z0-9]+)/type-([0-9]+)/price-([0-9]+)-([0-9]+)/?$ search.php?category=$1&location=$2&type=$3&minprice=$4&maxprice=$5 [L] RewriteRule ^search/(car...

Setting a default Apache RewriteRule entry

I want to set a 'default' rewrite rule to catch anything that didn't match the previous rewrite entries. I've tried this: RewriteRule ^(.*)/?$ index.php?url=$1 [L] But the output returned is: url = index.php Ideally what I want is to attach all the GET values to 'url' so they will be saved to my web log. Anyone have any suggestions...

Struts2 URL with .action

I want the URL of the below format http://localhost/users/abc rather than http://localhost/users?name=abc How to achieve this in Struts2? ...

Intelligencia UrlRewriter.NET not working properly on IIS 6?

I'm having an issue getting the following syntax to work: <rewriter> <!-- This does NOTHING --> <if url="whywontthiswork\.aspx" rewrite="/default.aspx" /> <!-- This redirects correctly --> <redirect url="whywontthiswork\.aspx" to="/default.aspx" /> </rewriter> As noted, the first rule does nothing no matter what I try...

Can I substitute MVC Routing for legacy WebForms URL Rewriting?

I'm currently migrating a large website from WebForms to MVC. It's going to be a long process, I can't go through every page and migrate it right away, nor do I want to. One of the issues I have is, in the old web app, we were doing some URL Rewriting for the WebForms stuff like so: from: http://sample.com/id/123/name/Something/Page.as...

301 redirect from mod_rewrite RewriteMap program

I'm using mod_rewrite's RewriteMap directive to process URLs. My RewriteMap program is a PHP script and everything is running fine. I'm able to map friendly URLs to PHP program + ID. Anyway, what I want to do is return a 301 redirect for certain URLs. For example, if someone puts in the URL: http://www.example.com/directory1 Then I wan...

how to configure iis7 http 301 redirection?

I have http://thewebsite.com/blah/category/hello.html We need to redirect any url with /blah/ to the root of the site so that the new url is http://thewebsite.com/category/hello.html How can we do this with iis7? Thanks in advance. Edit: I have just learned that our problem is not about 301-redirection but rather about url-rewrite. We...

Using ModRewrite to get rid of extentions

I would like to get rid of all the file extensions on my site. Except when they are on the index i would like it to say nothing... change this foo.com/index.html to this foo.com/ and when the user goes to another page like foo.com/contact-us.html it will be foo.com/contact-us RewriteEngine On RewriteRule ^ this is where i get confused...

Apache rewrite url need help

Hello everyone I need help for apache mode rewrite cause I'm novice and. Actually I don't know how to make this done. here is mys problem I have some urls that I want to edit them with apache 1- mywebsite/category.php ---> I want that url to stay like it is mywebsite/category.php?sid=categoryname ---> ...

URL Structure Parent to Child Relationship With Static Files

Currently I can not show site structure in the url IE www.site.com/parent-page/child-page without creating a subdirectory at the root. Is there an easy way to dynamically create the parent to child relationship other than creating subdirectories? ...

why asp.net Url rewriting throw exception when same folder is exists physicaly?

Im redirect like this: rewrite url="~/aboutus/" to="~/AboutUs/AboutUsView.aspx" but "AboutUs" folder physically exists. so IIS throw exception: Directory Listing -- /WebSite/aboutus/ but this rewritin work good: rewrite url="~/about/" to="~/AboutUs/AboutUsView.aspx" "About" folder is not exist physically. im using Intelligencia.Url...