htaccess Rewrite on 1and1 hosting  | Expert | | Join Date: Jan 2008 Location: Bath, UK
Posts: 1,609
| |
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. - Options +FollowSymLinks
-
RewriteEngine on
-
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
|  | Moderator | | Join Date: Aug 2008 Location: Leipzig, Germany
Posts: 3,635
| | | re: htaccess Rewrite on 1and1 hosting
does your 1&1 account support mod_rewrite? (check in phpinfo())
|  | Moderator | | Join Date: Jun 2007 Location: York, England, with wolves.
Posts: 4,936
| | | re: htaccess Rewrite on 1and1 hosting
Check your error logs (apache).
Moved this to misc because it isn't PHP nor Apache.
|  | Expert | | Join Date: Jan 2008 Location: Bath, UK
Posts: 1,609
| | | re: htaccess Rewrite on 1and1 hosting Quote:
Originally Posted by Markus Moved this to misc because it isn't PHP nor Apache. 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.
|  | Moderator | | Join Date: Jun 2007 Location: York, England, with wolves.
Posts: 4,936
| | | re: htaccess Rewrite on 1and1 hosting Quote:
Originally Posted by hsriat 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. 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?
|  | Expert | | Join Date: Jan 2008 Location: Bath, UK
Posts: 1,609
| | | re: htaccess Rewrite on 1and1 hosting
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: - Options +FollowSymLinks
-
RewriteEngine on
-
RewriteBase /
-
RewriteRule /([^/]+)/([^/]+) /index.php?id=$1&name=$2 [L]
|  | Moderator | | Join Date: Jun 2007 Location: York, England, with wolves.
Posts: 4,936
| | | re: htaccess Rewrite on 1and1 hosting Sure. I'd do it something like this: -
Options +FollowSymLinks
-
RewriteEngine on
-
RewriteBase /
-
# Note: no leading /
-
# Not sure what characters you want to allow, but you can expand the character set to incorporate them.
-
RewriteRule ^([a-zA-Z0-9]+)/([a-zA-Z0-9]+)$ /index.php?id=$1&name=$2 [L]
-
If you do only want to match alpha-numeric characters, you can use the expression '\w+' instead of the character sets [a-z...].
|  | Expert | | Join Date: Jan 2008 Location: Bath, UK
Posts: 1,609
| | | re: htaccess Rewrite on 1and1 hosting
Unfortunately 1and1 didn't like this one too.
Anyhow, thanks for the help Markus.
Cheers
|  | Moderator | | Join Date: Jun 2007 Location: York, England, with wolves.
Posts: 4,936
| | | re: htaccess Rewrite on 1and1 hosting Quote:
Originally Posted by hsriat Unfortunately 1and1 didn't like this one too.
Anyhow, thanks for the help Markus.
Cheers That's a shame :/ I don't know how I'd live without .htaccess access...
Np,
Mark.
|  | | | | /bytes/about
We are a network of experts and professionals in IT and software development that help one another with answers to tough questions and share insights.
Get the best answers to your questions from over 226,327 network members.
|