0

現在、Apache2PHP5本番インスタンスをローカル環境に移行しています。

.htaccessファイルで、次の書き換えルールを見つけました。

RewriteRule ^profile/?$ profile.php

動作しています。ただし、localhost / profileにアクセスしようとすると、空のページが表示され、応答ヘッダーにこの追加が表示されます

Content-Location:profile.class.php

ルールを^profile/?$以外に変更した場合、^ profile /?$と言うとすべてが機能します。

この奇妙な動作、名前の衝突、予約語の原因は何ですか?

これがmod_rewriteからのログです

% tail -f rewrite.log                          
192.168.0.31 - - [30/Oct/2012:16:18:31 +0100] [192.168.0.40/sid#7f930db80978][rid#7f930d9c00a0/subreq] (3) [perdir /var/www/] strip per-dir prefix: /var/www/profile.php -> profile.php
192.168.0.31 - - [30/Oct/2012:16:18:31 +0100] [192.168.0.40/sid#7f930db80978][rid#7f930d9c00a0/subreq] (3) [perdir /var/www/] applying pattern '^sign-up/?([a-f0-9]+)?/?([a-f0-9]+)?/?$' to uri 'profile.php'
192.168.0.31 - - [30/Oct/2012:16:18:31 +0100] [192.168.0.40/sid#7f930db80978][rid#7f930d9c00a0/subreq] (3) [perdir /var/www/] strip per-dir prefix: /var/www/profile.php -> profile.php
192.168.0.31 - - [30/Oct/2012:16:18:31 +0100] [192.168.0.40/sid#7f930db80978][rid#7f930d9c00a0/subreq] (3) [perdir /var/www/] applying pattern '^sign-out/?$' to uri 'profile.php'
192.168.0.31 - - [30/Oct/2012:16:18:31 +0100] [192.168.0.40/sid#7f930db80978][rid#7f930d9c00a0/subreq] (3) [perdir /var/www/] strip per-dir prefix: /var/www/profile.php -> profile.php
192.168.0.31 - - [30/Oct/2012:16:18:31 +0100] [192.168.0.40/sid#7f930db80978][rid#7f930d9c00a0/subreq] (3) [perdir /var/www/] applying pattern '^new-app/?(budget)?/?([A-Za-z0-9-]+)?/?$' to uri 'profile.php'
192.168.0.31 - - [30/Oct/2012:16:18:31 +0100] [192.168.0.40/sid#7f930db80978][rid#7f930d9c00a0/subreq] (3) [perdir /var/www/] strip per-dir prefix: /var/www/profile.php -> profile.php
192.168.0.31 - - [30/Oct/2012:16:18:31 +0100] [192.168.0.40/sid#7f930db80978][rid#7f930d9c00a0/subreq] (3) [perdir /var/www/] applying pattern '^profile/([a-f0-9]{50})/?([a-f0-9]{50})?/?' to uri 'profile.php'
192.168.0.31 - - [30/Oct/2012:16:18:31 +0100] [192.168.0.40/sid#7f930db80978][rid#7f930d9c00a0/subreq] (3) [perdir /var/www/] strip per-dir prefix: /var/www/profile.php -> profile.php
192.168.0.31 - - [30/Oct/2012:16:18:31 +0100] [192.168.0.40/sid#7f930db80978][rid#7f930d9c00a0/subreq] (3) [perdir /var/www/] applying pattern '^profile/?([a-z0-9-]+)?/?$' to uri 'profile.php'
192.168.0.31 - - [30/Oct/2012:16:18:31 +0100] [192.168.0.40/sid#7f930db80978][rid#7f930d9c00a0/subreq] (3) [perdir /var/www/] strip per-dir prefix: /var/www/profile.php -> profile.php
192.168.0.31 - - [30/Oct/2012:16:18:31 +0100] [192.168.0.40/sid#7f930db80978][rid#7f930d9d20a0/initial] (3) [perdir /var/www/] strip per-dir prefix: /var/www/profile.class.php -> profile.class.php
192.168.0.31 - - [30/Oct/2012:16:18:31 +0100] [192.168.0.40/sid#7f930db80978][rid#7f930d9d20a0/initial] (3) [perdir /var/www/] applying pattern '^sign-in/?$' to uri 'profile.class.php'
192.168.0.31 - - [30/Oct/2012:16:18:31 +0100] [192.168.0.40/sid#7f930db80978][rid#7f930d9d20a0/initial] (3) [perdir /var/www/] strip per-dir prefix: /var/www/profile.class.php -> profile.class.php
192.168.0.31 - - [30/Oct/2012:16:18:31 +0100] [192.168.0.40/sid#7f930db80978][rid#7f930d9d20a0/initial] (3) [perdir /var/www/] applying pattern '^features/?$' to uri 'profile.class.php'
192.168.0.31 - - [30/Oct/2012:16:18:31 +0100] [192.168.0.40/sid#7f930db80978][rid#7f930d9d20a0/initial] (3) [perdir /var/www/] strip per-dir prefix: /var/www/profile.class.php -> profile.class.php
192.168.0.31 - - [30/Oct/2012:16:18:31 +0100] [192.168.0.40/sid#7f930db80978][rid#7f930d9d20a0/initial] (3) [perdir /var/www/] applying pattern '^features/([a-z0-9-]+)/?$' to uri 'profile.class.php'
192.168.0.31 - - [30/Oct/2012:16:18:31 +0100] [192.168.0.40/sid#7f930db80978][rid#7f930d9d20a0/initial] (3) [perdir /var/www/] strip per-dir prefix: /var/www/profile.class.php -> profile.class.php
192.168.0.31 - - [30/Oct/2012:16:18:31 +0100] [192.168.0.40/sid#7f930db80978][rid#7f930d9d20a0/initial] (3) [perdir /var/www/] applying pattern '^terms/?$' to uri 'profile.class.php'
192.168.0.31 - - [30/Oct/2012:16:18:31 +0100] [192.168.0.40/sid#7f930db80978][rid#7f930d9d20a0/initial] (3) [perdir /var/www/] strip per-dir prefix: /var/www/profile.class.php -> profile.class.php
192.168.0.31 - - [30/Oct/2012:16:18:31 +0100] [192.168.0.40/sid#7f930db80978][rid#7f930d9d20a0/initial] (3) [perdir /var/www/] applying pattern '^(all|books|business|education|entertainment|finance|games|healthcare-and-fitness|lifestyle|medical|music|navigation|news|photography|productivity|reference|social-networking|sports|travel|utilities|weather)/?$' to uri 'profile.class.php'
192.168.0.31 - - [30/Oct/2012:16:18:31 +0100] [192.168.0.40/sid#7f930db80978][rid#7f930d9d20a0/initial] (3) [perdir /var/www/] strip per-dir prefix: /var/www/profile.class.php -> profile.class.php
192.168.0.31 - - [30/Oct/2012:16:18:31 +0100] [192.168.0.40/sid#7f930db80978][rid#7f930d9d20a0/initial] (3) [perdir /var/www/] applying pattern '^(books|business|education|entertainment|finance|games|healthcare-and-fitness|lifestyle|medical|music|navigation|news|photography|productivity|reference|social-networking|sports|travel|utilities|weather)/([A-Za-z0-9-]+)/?$' to uri 'profile.class.php'
192.168.0.31 - - [30/Oct/2012:16:18:31 +0100] [192.168.0.40/sid#7f930db80978][rid#7f930d9d20a0/initial] (3) [perdir /var/www/] strip per-dir prefix: /var/www/profile.class.php -> profile.class.php
192.168.0.31 - - [30/Oct/2012:16:18:31 +0100] [192.168.0.40/sid#7f930db80978][rid#7f930d9d20a0/initial] (3) [perdir /var/www/] applying pattern '^(books|business|education|entertainment|finance|games|healthcare-and-fitness|lifestyle|medical|music|navigation|news|photography|productivity|reference|social-networking|sports|travel|utilities|weather)/([A-Za-z0-9-]+)/invite/?([a-z0-9-]+)?/?$' to uri 'profile.class.php'
192.168.0.31 - - [30/Oct/2012:16:18:31 +0100] [192.168.0.40/sid#7f930db80978][rid#7f930d9d20a0/initial] (3) [perdir /var/www/] strip per-dir prefix: /var/www/profile.class.php -> profile.class.php
192.168.0.31 - - [30/Oct/2012:16:18:31 +0100] [192.168.0.40/sid#7f930db80978][rid#7f930d9d20a0/initial] (3) [perdir /var/www/] applying pattern '^(books|business|education|entertainment|finance|games|healthcare-and-fitness|lifestyle|medical|music|navigation|news|photography|productivity|reference|social-networking|sports|travel|utilities|weather)/([A-Za-z0-9-]+)/(app-details|testers|test-reports|test-report|start|update|contact-tester)/?(\d+)?/?([a-z0-9-]+)?/?$' to uri 'profile.class.php'
192.168.0.31 - - [30/Oct/2012:16:18:31 +0100] [192.168.0.40/sid#7f930db80978][rid#7f930d9d20a0/initial] (3) [perdir /var/www/] strip per-dir prefix: /var/www/profile.class.php -> profile.class.php
192.168.0.31 - - [30/Oct/2012:16:18:31 +0100] [192.168.0.40/sid#7f930db80978][rid#7f930d9d20a0/initial] (3) [perdir /var/www/] applying pattern '^forgot-password/?$' to uri 'profile.class.php'
192.168.0.31 - - [30/Oct/2012:16:18:31 +0100] [192.168.0.40/sid#7f930db80978][rid#7f930d9d20a0/initial] (3) [perdir /var/www/] strip per-dir prefix: /var/www/profile.class.php -> profile.class.php
192.168.0.31 - - [30/Oct/2012:16:18:31 +0100] [192.168.0.40/sid#7f930db80978][rid#7f930d9d20a0/initial] (3) [perdir /var/www/] applying pattern '^connect-with-facebook/?$' to uri 'profile.class.php'
192.168.0.31 - - [30/Oct/2012:16:18:31 +0100] [192.168.0.40/sid#7f930db80978][rid#7f930d9d20a0/initial] (3) [perdir /var/www/] strip per-dir prefix: /var/www/profile.class.php -> profile.class.php
192.168.0.31 - - [30/Oct/2012:16:18:31 +0100] [192.168.0.40/sid#7f930db80978][rid#7f930d9d20a0/initial] (3) [perdir /var/www/] applying pattern '^account/?(confirm-email|reset-password|send-confirmation-link)/?([A-Za-z0-9]+)?/?([_\.0-9a-zA-Z-%+]+@([0-9a-zA-Z][0-9a-zA-Z-]+\.)+([a-zA-Z]{2,4}$))?$' to uri 'profile.class.php'
192.168.0.31 - - [30/Oct/2012:16:18:31 +0100] [192.168.0.40/sid#7f930db80978][rid#7f930d9d20a0/initial] (3) [perdir /var/www/] strip per-dir prefix: /var/www/profile.class.php -> profile.class.php
192.168.0.31 - - [30/Oct/2012:16:18:31 +0100] [192.168.0.40/sid#7f930db80978][rid#7f930d9d20a0/initial] (3) [perdir /var/www/] applying pattern '^public-scripts/?(add-device|propose-projects|generate-mass-payment|edit-device|your-devices|get-app-password|remove-device|beta-test-request|change-project-tester-status|download-udids|download-app|open-report|rate-report|reply|invite-search|invite-user|ignore-invite|uninvite|add-device-over-air|save-device-over-air|send-air-link|search-android-device)/?([A-Za-z0-9]+)?/?([A-Za-z0-9\.]+)?/?$' to uri 'profile.class.php'
192.168.0.31 - - [30/Oct/2012:16:18:31 +0100] [192.168.0.40/sid#7f930db80978][rid#7f930d9d20a0/initial] (3) [perdir /var/www/] strip per-dir prefix: /var/www/profile.class.php -> profile.class.php
192.168.0.31 - - [30/Oct/2012:16:18:31 +0100] [192.168.0.40/sid#7f930db80978][rid#7f930d9d20a0/initial] (3) [perdir /var/www/] applying pattern '^rss/?$' to uri 'profile.class.php'
192.168.0.31 - - [30/Oct/2012:16:18:31 +0100] [192.168.0.40/sid#7f930db80978][rid#7f930d9d20a0/initial] (3) [perdir /var/www/] strip per-dir prefix: /var/www/profile.class.php -> profile.class.php
192.168.0.31 - - [30/Oct/2012:16:18:31 +0100] [192.168.0.40/sid#7f930db80978][rid#7f930d9d20a0/initial] (3) [perdir /var/www/] applying pattern '^feed/?$' to uri 'profile.class.php'
192.168.0.31 - - [30/Oct/2012:16:18:31 +0100] [192.168.0.40/sid#7f930db80978][rid#7f930d9d20a0/initial] (1) [perdir /var/www/] pass through /var/www/profile.class.php
192.168.0.31 - - [30/Oct/2012:16:18:31 +0100] [192.168.0.40/sid#7f930db80978][rid#7f930d9cd0a0/initial] (1) [perdir /var/www/] pass through /var/www/favicon.ico
192.168.0.31 - - [30/Oct/2012:16:18:31 +0100] [192.168.0.40/sid#7f930db80978][rid#7f930d9c12c0/initial/redir#1] (3) [perdir /var/www/] strip per-dir prefix: /var/www/404.php -> 404.php

.htaccess

RewriteEngine on

RewriteRule ^sign-up/?([a-f0-9]+)?/?([a-f0-9]+)?/?$ sign-up.php?project_token=$1&invite_token=$2
RewriteRule ^sign-out/?$ sign-out.php
RewriteRule ^new-app/?(budget)?/?([A-Za-z0-9-]+)?/?$ new-app.php?stage=$1&app=$2
RewriteRule ^profile/([a-f0-9]{50})/?([a-f0-9]{50})?/? profile-other.php?token=$1&project=$2
RewriteRule ^profile/?([a-z0-9-]+)?/?$ profile.php?profile_menu_cat=$1
RewriteRule ^admin/?([a-z0-9-]+)?/?$ admin.php?profile_menu_cat=$1
RewriteRule ^faq/?(our-application|for-beta-testers|for-developers)?/?$ faq.php?app_cat=$1
RewriteRule ^get/?([A-Za-z0-9-]+)/?([a-z0-9]+)\.?(ipa|plist|apk)?/?$ download.php?url=$1&token=$2&$3
RewriteRule ^contact/?$ contact.php
RewriteRule ^sign-in/?$ sign-in.php
RewriteRule ^features/?$ features.php
RewriteRule ^features/([a-z0-9-]+)/?$ features.php?sub=$1
RewriteRule ^terms/?$ terms.php
RewriteRule ^(all|books|business|education|entertainment|finance|games|healthcare-and-fitness|lifestyle|medical|music|navigation|news|photography|productivity|reference|social-networking|sports|travel|utilities|weather)/?$ browse.php?category=$1

RewriteRule ^(books|business|education|entertainment|finance|games|healthcare-and-fitness|lifestyle|medical|music|navigation|news|photography|productivity|reference|social-networking|sports|travel|utilities|weather)/([A-Za-z0-9-]+)/?$ app.php?category=$1&app=$2&app_cat=$3&extra=$4

RewriteRule ^(books|business|education|entertainment|finance|games|healthcare-and-fitness|lifestyle|medical|music|navigation|news|photography|productivity|reference|social-networking|sports|travel|utilities|weather)/([A-Za-z0-9-]+)/invite/?([a-z0-9-]+)?/?$ invite.php?category=$1&app=$2&app_cat=invite&extra=$4

RewriteRule ^(books|business|education|entertainment|finance|games|healthcare-and-fitness|lifestyle|medical|music|navigation|news|photography|productivity|reference|social-networking|sports|travel|utilities|weather)/([A-Za-z0-9-]+)/(app-details|testers|test-reports|test-report|start|update|contact-tester)/?(\d+)?/?([a-z0-9-]+)?/?$ app.php?category=$1&app=$2&app_cat=$3&extra=$5&version=$4

RewriteRule ^forgot-password/?$ forgot-password.php
RewriteRule ^connect-with-facebook/?$ connect-with-facebook.php
RewriteRule ^account/?(confirm-email|reset-password|send-confirmation-link)/?([A-Za-z0-9]+)?/?([_\.0-9a-zA-Z-%+]+@([0-9a-zA-Z][0-9a-zA-Z-]+\.)+([a-zA-Z]{2,4}$))?$ account.php?1=$1&2=$2&3=$3
RewriteRule ^public-scripts/?(add-device|propose-projects|generate-mass-payment|edit-device|your-devices|get-app-password|remove-device|beta-test-request|change-project-tester-status|download-udids|download-app|open-report|rate-report|reply|invite-search|invite-user|ignore-invite|uninvite|add-device-over-air|save-device-over-air|send-air-link|search-android-device)/?([A-Za-z0-9]+)?/?([A-Za-z0-9\.]+)?/?$ public-scripts.php?1=$1&2=$2&3=$3
RewriteRule ^rss/?$ rss.php
RewriteRule ^feed/?$ rss.php

ErrorDocument 404 /404.php
4

1 に答える 1

2

これは、mod_negotiationが不要なときにそのことを実行しているように聞こえます。そのモジュールは、リクエストURIのファイルマッピングを、リクエストされたファイルに「近い」複数の異なるファイルに一致させようとします。オプションをオフにすることでオフにMultiviewsできます。ステートメントが表示されているvhost/server構成から削除するかOptions、htaccessで否定してみてください。

Options -Multiviews
于 2012-10-30T17:59:37.350 に答える