私は、新しいAngular 2/4アプリで古いzendウェブサイトをマージする際に問題があります。私はzendの別のURLとして私の角のアプリケーションを挿入したいと思います。Apache 2、Zend Angular 2 Appにリダイレクト
ドメインhttp://example.netは私のZend Webサイトにリダイレクトされます。 http://example.net/Angularは私のAngularアプリにリダイレクトされます。
私は別のファイルを作成し、すべてのコンパイル済みファイルをangular2からコピーしました。 http://example.net/Angularに行くとすごくうまくいっていますが、リンクを使ってウェブサイトを移動することができますが、http://example.net/Angular/profile/12のような入れ子になったリンクをリフレッシュしたり送信したりすると、404ページのzendにリダイレクトされます。
角度アプリの.htaccess
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase/
RewriteRule ^index\.html$ - [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /index.html [L]
</IfModule>
このアプリではZendの.htaccess
Options +FollowSymLinks +ExecCGI
php_value upload_max_filesize 24M
php_value post_max_size 24M
php_value memory_limit 512M
RewriteCond %{HTTPS} !=on
RewriteRule ^.*$ https://%{SERVER_NAME}%{REQUEST_URI} [R,L]
#https:// -> https://www.
php_value safe_mode "0"
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase/
RewriteCond %{HTTP_USER_AGENT} msnbot [NC]
RewriteRule . - [F]
RewriteCond %{HTTP_HOST} ^example.net [NC]
#^ -> https://www.
RewriteRule ^(.*)$ https://www.example.net%{REQUEST_URI} [R=301,L]
#http -> https
# newsletter stats collector
RewriteCond %{REQUEST_URI} ^/ns/[0-9]+/[^/]+$
RewriteRule ^(.*)$ _newsletter_stats.php [L]
RewriteRule ^action/order.php order.php [L]
# newsletter tracker
RewriteCond %{REQUEST_URI} ^/nt/[0-9]+$
RewriteRule ^(.*)$ _newsletter_tracker.php [L]
ErrorDocument 404 /404.html
RewriteCond %{REQUEST_URI} \..+$
RewriteCond %{REQUEST_URI} !\.html$
RewriteCond %{REQUEST_URI} !\.pdf$
RewriteRule .* - [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^(.*)$ index.php [QSA,L]
</IfModule>
<IfModule mod_deflate.c>
AddOutputFilterByType DEFLATE text/plain
AddOutputFilterByType DEFLATE text/html
AddOutputFilterByType DEFLATE text/javascript application/x-javascript
</IfModule>
<IfModule mod_gzip.c>
mod_gzip_on Yes
mod_gzip_dechunk Yes
mod_gzip_item_include file \.(html?|txt|js|php|pl|jpg|png|gif|css)$
mod_gzip_item_include handler ^cgi-script$
mod_gzip_item_include mime ^text/.*
mod_gzip_item_include mime ^application/x-javascript.*
mod_gzip_item_exclude mime ^image/.*
mod_gzip_item_exclude rspheader ^Content-Encoding:.*gzip.*
</IfModule>
<IfModule mod_setenvif.c>
# Netscape 4.x has some problems�
BrowserMatch ^Mozilla/4 gzip-only-text/html
# Netscape 4.06-4.08 have some more problems
BrowserMatch ^Mozilla/4\.0[678] no-gzip
# MSIE masquerades as Netscape, but it is fine
BrowserMatch \bMSIE !no-gzip !gzip-only-text/html
# NOTE: Due to a bug in mod_setenvif up to Apache 2.0.48
# the above regex won�t work. You can use the following
# workaround to get the desired effect:
#BrowserMatch \bMSI[E] !no-gzip !gzip-only-text/html
# Don�t compress already-compressed files
SetEnvIfNoCase Request_URI .(?:gif|jpe?g|png)$ no-gzip dont-vary
SetEnvIfNoCase Request_URI .(?:exe|t?gz|zip|bz2|sit|rar)$ no-gzip dont-vary
SetEnvIfNoCase Request_URI .(?:avi|mov|mp3|mp4|rm|flv|swf|mp?g)$ no-gzip dont-vary
SetEnvIfNoCase Request_URI .pdf$ no-gzip dont-vary
</IfModule>
<FilesMatch ".(ico|jpg|jpeg|png|gif|js|swf|css)$">
<IfModule mod_expires.c>
ExpiresActive on
ExpiresDefault A604800
Header append Cache-Control "public"
</IfModule>
Header unset ETag
FileETag None
</FilesMatch>
ルーティングシステムは、このサイトをコーディングされた人々に、おそらく不明であるので、私は固執したいと思いますhtaccessとAngularソリューション
また、私は既にノードサーバーや他のApache 2を実行することはできません...ホスティング。
正しいですが、最初の.htaccessは必須ではありませんが、指定したコードはすべてのネストされたURLで内部サーバーエラー500を引き起こします。 –
Apacheエラーログにアクセスできますか?おそらくより良いリダイレクトで投稿を編集します –