简体   繁体   中英

1and1 mod_rewrite issues

I'm currently trying to have my 1and1 host an .htaccess file with mod_rewrite enabled, it works on my local wamp, but it doesn't on the server,

Any help would be greatly appreciated!

I've tried removing everything but the mod_rewrite block and the issue still persists...

I've asked 1&1 for support, they closed my ticket without answering... o_O,

Please help!

.htaccess file:

#
# Dream Forgery Settings:
#
AddType x-mapp-php5 .php

RewriteEngine on
RewriteBase /

# Rewrite current-style URLs of the form 'strap.php?q=x'.
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ /strap.php?q=$1 [L,QSA]

Edit:

I don't have access to apache logs as this is a shared hosting, but the functionality expected is to redirect urls for example:

http://example.com/arg1/arg2/arg3

to

http://example.com/strap.php?q=arg1/arg2/arg3

(it is currently giving 404 errors, only the 404 page from 1&1 shows up)

Found the answer here:

Adding the following fixed the mod-rewrite:

Options -MultiViews

http://www.techpopuli.net/news/04/002289.html

Ran into a similar issue on a mutualised web hosting from 1and1.

Symptoms:

  • frontend homepage ok
  • frontend other page -> err500
  • admin page ok
  • being a 1and1 shared web hosting, no apache error_log available

Joomla 3.9 comes with a .htaccess (in the root directory) that messed it up at line 69:

RewriteBase /

Commenting this line does the trick.

Delete everything but the important bits...

AddType x-mapp-php5 .php 

RewriteEngine on
RewriteBase /

# Rewrite current-style URLs of the form 'strap.php?q=x'.
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ /strap.php?q=$1 [L,QSA]

...and see what happens. The rest of the file isn't necessary—this'll [hopefully] isolate the problem. And 1 & 1 supports .htaccess .

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM