2
我一直在试图让本网站在我的本地机器上工作,但链接不再工作,因为.htaccess文件设置,我一直没有试图改变。该网页的内容是在一个数据库中,并且链接看起来像htaccess重写本地主机的更改
<a href="<?=$linkLocations?>" id="bestLoc"<?=$activeBest?>>Best Locations</a>
变量被定义为一个全球性的
$linkLocations = $URL . '/best-locations';
和bestLocations实际上是查询数据库的PHP文件。 .htaccess文件还是有不少的重写规则,这里是完整的文件
# compress text, html, javascript, css, xml:
AddOutputFilterByType DEFLATE text/plain
AddOutputFilterByType DEFLATE text/html
AddOutputFilterByType DEFLATE text/xml
AddOutputFilterByType DEFLATE text/css
AddOutputFilterByType DEFLATE application/xml
AddOutputFilterByType DEFLATE application/xhtml+xml
AddOutputFilterByType DEFLATE application/rss+xml
AddOutputFilterByType DEFLATE application/javascript
AddOutputFilterByType DEFLATE application/x-javascript
ExpiresActive On
ExpiresByType image/gif A2592000
ExpiresByType image/jpeg A2592000
ExpiresByType image/jpg A2592000
ExpiresByType image/png A2592000
ExpiresByType image/x-icon A2592000
ExpiresByType text/css A604800
ExpiresByType application/javascript A604800
ExpiresByType application/x-shockwave-flash A2592000
<FilesMatch "\.(gif¦jpe?g¦png¦ico¦css¦js¦swf)$">
Header set Cache-Control "public"
</FilesMatch>
RewriteEngine on
fafaf
RewriteCond %{HTTP_HOST} !^$
RewriteCond %{HTTP_HOST} !^www\. [NC]
RewriteCond %{HTTPS}s ^on(s)|
RewriteRule^http%1://www.%{HTTP_HOST}%{REQUEST_URI} [R=301,L]
RewriteRule ^communities/([a-zA-Z0-9\_\-]+)$ communities/index.php?community=$1 [NC]
RewriteRule ^communities/([a-zA-Z0-9\_\-]+)/$ communities/index.php?community=$1 [NC]
RewriteRule ^communities/([a-zA-Z0-9\_\-]+)/([a-zA-Z0-9\_\-]+)$ communities/index.php?community=$1&commPage=$2 [NC]
RewriteRule ^communities/([a-zA-Z0-9\_\-]+)/([a-zA-Z0-9\_\-]+)/$ communities/index.php?community=$1&commPage=$2 [NC]
RewriteRule ^communities/([a-zA-Z0-9\_\-]+)/([a-zA-Z0-9\_\-]+)/([a-zA-Z0-9\_\-]+)$ communities/index.php?community=$1&commPage=$2&model=$3 [NC]
RewriteRule ^communities/([a-zA-Z0-9\_\-]+)/([a-zA-Z0-9\_\-]+)/([a-zA-Z0-9\_\-]+)/$ communities/index.php?community=$1&commPage=$2&model=$3 [NC]
RewriteRule ^([a-zA-Z0-9\_\-]+)$ subpage.php?page=$1 [NC]
RewriteRule ^([a-zA-Z0-9\_\-]+)/$ subpage.php?page=$1 [NC]
RewriteRule ^([a-zA-Z0-9\_\-]+)/([a-zA-Z0-9\_\-]+)$ subpage.php?page=$1&sp=$2 [NC]
RewriteRule ^([a-zA-Z0-9\_\-]+)/([a-zA-Z0-9\_\-]+)/$ subpage.php?page=$1&sp=$2 [NC]
RewriteRule ^([a-zA-Z0-9\_\-]+)/([a-zA-Z0-9\_\-]+)/([a-zA-Z0-9\_\-]+)$ subpage.php?page=$1&sp=$2&spd=$3 [NC]
RewriteRule ^([a-zA-Z0-9\_\-]+)/([a-zA-Z0-9\_\-]+)/([a-zA-Z0-9\_\-]+)/$ subpage.php?page=$1&sp=$2&spd=$3 [NC]
- 我还没有从现场版改变了重写。
- 我通过WAMP通过本地主机/宾利/访问URL
- 活动网站是http://bentleyhomes.com
- 的网站没有链接的网页, 而是PHP文件输出数据库数据 的目录结构
我知道我在这里错过了很多,可能超出了我的深度,但如果任何人都可以指出我的大方向,我将不胜感激;我在htaccess教程上花了一个上午,但对我来说这仍然有点困难。
所以....究竟是什么不起作用?如果你不确定,你应该发布你的整个.htaccess文件内容,而不是你认为会是问题的内容。 :) –
而您用来访问本地服务器的示例url –
RewriteCond%{HTTPS} s^on(s)|我对这种结构不熟悉,是一个错字,还是它实际上是它所说的?在创建路径时让它们变为/更容易,这样您就不必担心服务器本地或域这听起来对我来说更像是你有一个设置本地虚拟主机配置的问题,而不是使用重写规则的任何东西 – Lizardx