doucuan5365 2012-02-16 14:12
浏览 25

htaccess问题与seo重写的网址

I'm having an issue with my .htaccess script which handles seo rewrites that masks php pages to look like directory structures. For example, /contact-us/ would point to contact.php, and /portfolio/ points to portfolio.php and so forth. The script works fine on our Apache 2 dev server, but when I move it to a shared hosting server (not sure of their apache version), rewrites with hyphens work, but the ones without a hyphen do not. I can't even get a copy of the rewrite logs to be able to see where the error is occurring. Here is a sample of my .htaccess file:

Options +FollowSymLinks
RewriteEngine On

RewriteBase /

#Force www link
RewriteCond %{HTTP_HOST} !^www.website.com [NC]
RewriteRule ^(.*)$ http://www.website.com/$1 [R=301,NC,L]

#force trailing slash on files
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_URI} !(.*)/$
RewriteRule ^(.*)$ $1/ [L,R=301]

RewriteRule ^index.php$ / [R,NC]
ReWriteRule ^who-we-are/$ whoweare.php [NC,L]
ReWriteRule ^portfolio/$ portfolio.php [NC,L]
ReWriteRule ^portfolio/web-development/$ portfolio_webdev.php [NC,L]

So, /who-we-are/ seems to redirect correctly, but /portfolio/ doesn't. I'm wondering if anyone can spot an error or something I am not doing correctly?

Please help.

  • 写回答

0条回答 默认 最新

    报告相同问题?

    悬赏问题

    • ¥15 c语言怎么用printf(“\b \b”)与getch()实现黑框里写入与删除?
    • ¥20 怎么用dlib库的算法识别小麦病虫害
    • ¥15 华为ensp模拟器中S5700交换机在配置过程中老是反复重启
    • ¥15 java写代码遇到问题,求帮助
    • ¥15 uniapp uview http 如何实现统一的请求异常信息提示?
    • ¥15 有了解d3和topogram.js库的吗?有偿请教
    • ¥100 任意维数的K均值聚类
    • ¥15 stamps做sbas-insar,时序沉降图怎么画
    • ¥15 买了个传感器,根据商家发的代码和步骤使用但是代码报错了不会改,有没有人可以看看
    • ¥15 关于#Java#的问题,如何解决?