Page 1 of 1

Can you create front-end for .HTACCESS?

Posted: Fri Oct 08, 2010 9:22 am
by simonmlewis
Hi all.

I need to create a way of applying shorturls to pages. I've seen it on some web sites where www.domain.com/thispage is actually going to some long URL.

I either need to do it using HTACCESS, or is there a way to create a FOLDER and a HTML with dynamic numbers in the code, on the fly?

So for example, you have www.somedomain.co.uk, and someone creates an account.
I want that account to create a /joseph on the fly, either thru htaccess, or a physical folder on the server. With either a meta refresh redirect, or a

Code: Select all

<script>
window.location.replace('https://www.domain.co.uk/index.php?page=myprofile&u=y')
</script>
Type code placed into the file.

I've really no idea how to do either, or what is the best method to do it and manage.

Re: Can you create front-end for .HTACCESS?

Posted: Fri Oct 08, 2010 9:29 am
by twinedev
At work now, so can't dive into explanation too much, but what you are looking for is the use of mod_rewrite (which most likely can be set up via .htaccess, most hosting does allow this).

I always end up looking up examples when I need to do it, else I'd post exact code here for you. You can have it either be simple:

http://domain.com/jospeh redirects to a something like http://domain.com/index.php?page=myprof ... ame=joseph

(the script being called, to be useful, needs to have what you entered passed to it.

-Greg