473,325 Members | 2,442 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,325 software developers and data experts.

htaccess Rewrite on 1and1 hosting

hsriat
1,654 Expert 1GB
I had a .htaccess file for Rewrite on my server and was working fine. Now when I used the same code in 1and1 hosting, its not working.

May be something is wrong or unexpectedly good happening inside 1and1 servers.

Expand|Select|Wrap|Line Numbers
  1. Options +FollowSymLinks
  2. RewriteEngine on
  3. RewriteRule /id/(.*)/name/(.*) index.php?id=$1&name=$2
If anyone knows what's required to be changed to make it work on 1and1, please let me know.

Thanks
Jun 9 '09 #1
8 4036
Dormilich
8,658 Expert Mod 8TB
does your 1&1 account support mod_rewrite? (check in phpinfo())
Jun 9 '09 #2
Markus
6,050 Expert 4TB
Check your error logs (apache).

Moved this to misc because it isn't PHP nor Apache.
Jun 9 '09 #3
hsriat
1,654 Expert 1GB
@Markus
At least people go to PHP forum... no body goes to misc. ;)

Anyway, I think there's some problem with 1and1 ... many people have similar problem, and nobody got any solution.
Jun 9 '09 #4
Markus
6,050 Expert 4TB
@hsriat
I disagree; I go to misc on my daily 'rounds'. But, then again, I have a pretty boring life at the moment.

Try a host better than 1and1?
Jun 9 '09 #5
hsriat
1,654 Expert 1GB
Umm... that's what is not in my hands.

Anyhow, can you tell me how would you do this rewrite:

www.example.com/index.php?id=wolves&name=Markus
to
www.example.com/wolves/Markus

What I did was this:
Expand|Select|Wrap|Line Numbers
  1. Options +FollowSymLinks
  2. RewriteEngine on
  3. RewriteBase /
  4. RewriteRule /([^/]+)/([^/]+) /index.php?id=$1&name=$2 [L]
Jun 11 '09 #6
Markus
6,050 Expert 4TB
@hsriat
Sure. I'd do it something like this:

Expand|Select|Wrap|Line Numbers
  1. Options +FollowSymLinks
  2. RewriteEngine on
  3. RewriteBase /
  4. # Note: no leading /
  5. # Not sure what characters you want to allow, but you can expand the character set to incorporate them.
  6. RewriteRule ^([a-zA-Z0-9]+)/([a-zA-Z0-9]+)$ /index.php?id=$1&name=$2 [L]
  7.  
If you do only want to match alpha-numeric characters, you can use the expression '\w+' instead of the character sets [a-z...].
Jun 11 '09 #7
hsriat
1,654 Expert 1GB
Unfortunately 1and1 didn't like this one too.

Anyhow, thanks for the help Markus.

Cheers
Jun 12 '09 #8
Markus
6,050 Expert 4TB
@hsriat
That's a shame :/ I don't know how I'd live without .htaccess access...

Np,

Mark.
Jun 12 '09 #9

Sign in to post your reply or Sign up for a free account.

Similar topics

7
by: Nel | last post by:
Just looking for some general advice on modifying the URL for php. I am using .htaccess to allow a web site to translate example.html to index.php?content=example (below) ErrorDocument 404...
15
by: Taki Jeden | last post by:
Hello everybody Does anybody know why w3c validator can not get pages that use 404 htaccess redirection? I set up two web sites so that clients request non-existent urls, but htaccess redirects...
6
by: somaboy mx | last post by:
Hello I need people to be able to complete long text blocks in my cms before their session times out. From the php documentation I gather that ini directive session.gc_maxlifetime would be the...
13
by: Don Conrad | last post by:
Has anyone used this hosting service? I'm considering it (linux based) and was wondering if anyone had any experience with them. TIA. Don
5
by: deko | last post by:
I'm trying to redirect requests for /index.php to /mydirectory/index.php If I use an index file in / with only this line: <?php header("Location:http://www.mysite.com/mydirectory/"); ?> that...
0
by: asherwolf | last post by:
Hi, I'm trying to do something I think is pretty neat, but I've just about pulled my hair out by the behavior of my server. I'm hosting on GoDaddy, using a subdomain (www.mywebpage.com maps to...
9
by: invertigo | last post by:
Hello, Im using this .htaccess file to rewrite my websites URL. Reason i try to do this is to make it more SEO friendly. Code: -------------------------------------------------------- Options...
3
by: Joe | last post by:
Hello, I currently have a file system where images and assets are stored in a directory like this: http://www.domain.com/assets/media/CLIENT_NAME/uploads/CLIENT_DIR/CLIENT_FILES Which holds...
4
by: adnanjunk | last post by:
Hi, Having a little issue with .htaccess not working on windows server. I have clean url's setup using the htaccess file, working fine on linux server. I have researched for a while and found...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.