1and1 mod_rewrite 问题

发布于 2024-12-24 01:57:46 字数 891 浏览 1 评论 0 原文

我目前正在尝试让我的 1and1 托管一个启用了 mod_rewrite 的 .htaccess 文件,它可以在我的本地 wamp 上运行,但不能在服务器上运行,

任何帮助将不胜感激!

我已经尝试删除除 mod_rewrite 块之外的所有内容,但问题仍然存在...

我已向 1&1 寻求支持,他们在没有回答的情况下关闭了我的票证... o_O,

请帮忙!

.htaccess 文件:

#
# 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]

编辑:

我无权访问 apache 日志,因为这是共享托管,但预期的功能是重定向 url,例如:

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

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

(当前给出 404 错误,仅显示 1&1 中的 404 页面)

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)

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(3

韬韬不绝 2024-12-31 01:57:46

在这里找到答案:

添加以下内容修复了 mod-rewrite:

Options -MultiViews

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

Found the answer here:

Adding the following fixed the mod-rewrite:

Options -MultiViews

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

送君千里 2024-12-31 01:57:46

删除除重要部分以外的所有内容......

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]

然后看看会发生什么。文件的其余部分不是必需的——这将[希望]隔离问题。和 1 & 1 支持.htaccess

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.

昨迟人 2024-12-31 01:57:46

在 1and1 的共同网络托管上遇到了类似的问题。

症状:

  • 前端主页正常
  • 前端其他页面-> err500
  • 管理页面可以
  • 作为 1and1 共​​享网络托管,没有可用的 apache error_log

Joomla 3.9 附带了一个 .htaccess (在根目录中),它在第 69 行搞砸了:

RewriteBase /

注释这一行可以解决问题。

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.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文