Click to See Complete Forum and Search --> : rewrite url


sitehatchery
05-20-2008, 12:12 AM
What is the complete code I need to rewrite:
http://www.sitehatchery.com/a/some-page.php

so that it looks like:
http://www.sitehatchery.com/some-page.php

Basically, just taking the "a/" out of the URL.

Is that possible? If so, how would I write the .htaccess file for this?

Note: I don't want to redirect.

sitehatchery
05-20-2008, 01:40 PM
anybody?

SyCo
05-20-2008, 03:34 PM
You've been here in these boards for a while. You know asking for the 'complete code' is never cool, thats what freelancers are for. I'm guessing that's why you've not had a response.

Anyway, what have you tried, post up what didn't work and any results.

I'm not on apache so can't test but as I remember from way back it's something like this

RewriteEngine on
RewriteRule ^a/$ /

Although I'm sure now someone will tell me I'm wrong :)

sitehatchery
05-20-2008, 11:59 PM
Thanks!

sitehatchery
05-21-2008, 12:28 AM
I've tried many different things.

Mostly trying variations of this:

RewriteEngine on
RewriteRule ^{DOCUMENT_ROOT}/site_folder/a/(*)$ {DOCUMENT_ROOT}/site_folder/(*)

and I've switched the two statements.

I tried yours and followed other suggestions on tutorials. But the tutorials I found refer to rewriting a dynamic url.

sitehatchery
05-23-2008, 02:25 AM
Let me try to say this a different way:

I have a site with the URL like this:

http://somesite_dot_com/a/somepage.php

I'd like .htaccess to take out the "a/" in the middle

Tutorials I've looked through have to do with dynamic URLs and I've tried many different variations to try to get this to work. But I'm not that great at .htaccess since I've run my sites on IIS for several years.

Can this be done?