url-rewriting

.htaccess for clean URL not working

I am working with PHP and htacess for the first time. I am passing a variables in a query string to a URL and want this URL to look clean. Please help. .htaccess file RewriteEngine On RewriteRule ^id-([0-9]+)/([0-9A-Za-z]+).html /detail.php?id=$1&display=$2 PHP code passing from one file to detail page URL is: <a href='/detail.ph...

Mod_rewrite invisibly: works when target is a file, not when it's a directory.

I have this rewrite rule that turns foo.com/test (or foo.com/test/) into foo.com/test.txt: RewriteRule ^test/?$ test.txt [NC,L] It works perfectly and, importantly, never reveals to the user that the "real" URL is foo.com/test.txt. Now I want to do the same thing where the "real" URL is foo.com/testdir, where testdir is a directory: ...

Masking Domain URL with Sub domain URL

Hai i'm having a subdomain (abc.example.in) but this is referred to mydomain/folder . the thing is i want the mask URL links and the masked url should be displayed following with sub domain can any one help me out . mydomain/folder/path to abc.example.in/path ...

How can I store location data in the url for all pages on my asp.net site using url rewriting?

Using { ASP.NET 3.5 , Windows Server 2003 , IIS 6 } I'd like to optimize my site for SEO. For the sake of example, I have a site with three pages: /news.aspx - a page that lists news articles /events.aspx - a page that lists events /location.aspx - a page that determines user's geographic location If user visits /news.aspx or /ev...

.htaccess question : Can I strip out a leading question mark?

Hi, I have a page that already has the $_GET array initialized, and when a page redirects there (with an oAuth token) it appends the ?token=36264747 to the end. Is there a way to write an .htaccess file for an Apache server that would either strip that question mark or (better) replace it with an ampersand? ...

htaccess conditions + url rewrite

Currently, I have the setup in my htaccess so that example.com/dept/noc goes to: example.com/index.php?dept=dept&n=noc using RewriteEngine On RewriteRule ^([A-Za-z]+)/([A-Za-z]+)$ index.php?dept=$1&n=$2 [QSA] RewriteCond %{SERVER_PORT} 80 I have a folder called upload, how would I ensure that url rewriting is not in effect (an excepti...

How can i understand a web site's language which is written by url rewriting method?

I'm wondering. Is there any way or online service for learning? ...

Problem with UrlRewritingNet

I have a problem with UrlRewritingNet.UrlRewriter.dll (http://urlrewriting.net/149/en/home.html)! I use html extensions instead aspx like: http://myhost.com/defaul.aspx -> I overwrite to http://www.myhost.com/defaul.html, add specific rule to web.config. It works fine on VS2008 developer server, but doesn't on live server. Is it possib...

Custom URL aliases in Drupal 6

I have several pages in my drupal website that produce custom query strings. The query string values and aliases I want to use are referenced from a MYSQL database. I've seen examples for this in Drupal 5 using the custom_url_rewrite function but not in 6... can somebody provide me with an example of how to do this? Thanks ...

URL Mod-Rewrite

Hello, I currently have a working URL: http://example.com/security-services.php?service=fixed-camera-surveillance and then I have PHP say, $_REQUEST['service'] to do some stuff... But I'd like to achieve the same function if the URL looked like this: http://example.com/security-services/fixed-camera-surveillance Thanks! ...

How to do dynamic URL Rewriting in J2EE

Back in my ASP.NET days, I used URLRewriter.NET to do dynamic URL Rewrites. Basically, it's an HTTPModule that intercepts page requests and rewrites the URLs according to rules that you define, very similar to MOD_REWRITE. However, it also lets you define a "Custom Transform," a class with a single method that does URL translations for...

WordPress url rewriting for Java

Hello stackoverflow, I currently work with Java JBoss Seam. I've been looking for some information on how to url rewriting, to accomplish something like what WordPress does. In WordPress you can create a page and give out a url for that page. Thats pretty sweet. How could I accomplish that in Java? preferably in Seam? Some reading w...

Domains & Foreward Slash

Hi, This is rather difficult to explain so please bear with me. We will be hosting 4 websites on our server and the plan is to have each site sit under its own domain: site-a.com site-b.com sub1.site-b.com sub2.site-b.com Notice the two sub domains! However, our client has asked if we can implement the following url structure inst...

Could I get by HttpModule the URL that contains * before ?

My web-site is working under ASP.NET 3.5, IIS7, Integrated pipiline mode. My HttpModule is getting request to all resources, including URLs like this: http://my-site.com/address And I would support '*' symbol in the URL for users. All attempts to navigate to such address are blocked by ASP.NET with the following error message: HTTP ...

Have some RewriteCond's affect multiple rules

I have a website where various parts parse request URLs by themselves and some don't (e.g. a vBulletin forum). The .htaccess I have to send requests to the appropriates scripts is: # wiki, shop, admin RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{REQUEST_FILENAME} !-d RewriteCond %{REQUEST_FILENAME} !(.*)\.js RewriteRule ^wiki/(.*)$...

Basic URL Rewrite Problem in PHP (mod_rewrite)

In my .htaccess, I have the following RewriteEngine On RewriteRule ^users/?$ users.php RewriteRule ^users/([a-z]+)/?$ users.php?username=$1 Everything works as intended if I do http://example.com/users/ http://example.com/users/joeschmoe/ and PHP will read "joeschmoe" as the value for $_GET['username'] However, if I do ht...

Developing Locally for a site that, when live, utilises Url Rewriting.

I've just installed and configured my server (WS2008, IIS7) with version 2 of the URL Rewriting Module. I've setup a simple static redirect as follows /contact >>> /pages/contact/default.aspx So users of the site have a simple url to get to the original, longer file path. It works great and even post backs to the right place. My ques...

Best practices for converting an existing website into a website with SEF URL

I've got a website that was created about an year ago and its been constantly revised since then. The website is coded in classic ASP, contains about ~50 pages -- some are multi-purpose, and contains old-school style links such as: /news.asp?PageIndex=4 /news.asp?SearchString=Obama /news.asp?SearchString=Obama&PageIndex=4 /news.asp?News...

URL rewrite - web.config error

I am getting the following error when i run my .aspx page. Error Code0x8007000d The configuration section 'rewrite' cannot be read because it is missing a section declaration I have a simple v.aspx page which has the following code: Response.Write(Request("q")) My hosting server as IIS 7 installed with URL rewrite feature enabled (th...

'+' symbol in htaccess

I am using htaccess. I try to pass a value in url like 'C++'. like "http://domain.com/Details/c++/detail.html" I am retrieving the value in htaccess like RewriteRule ^Details/([a-zA-Z_0-9_.,'&/-]+)/(([a-zA-Z_0-9_.,'&/-]+).html)$ index.php?page=$2&id=$1 But it returns only 'c'. Symbol '+' not accepted. I need the the value 'c++'. I...