dsk95913 2013-06-27 14:32
浏览 20
已采纳

SEO友好.htaccess总是引导我到主页

I have problem with seo friendly url. I've try to change my url with .htaccess and off course I have problem.

My link in header for my contact page is like this:

index.php?=contact

So I wrote rules in .htaccess like this:

Options +FollowSymLinks

RewriteEngine On
RewriteRule ^contact index.php?=contact

And off course changed my link in header to be like this:

contact

And now when I click on contact on header I get nice url like this:

www.mywebsite.com/contact

But website lead me always to home page (index.php).

What I did wrong?

  • 写回答

2条回答 默认 最新

  • duandi8613 2013-06-29 19:26
    关注

    I made this clear, and now working. I just changed link, and put page. Static link working now for me, but how to write to dinamic link. For instance, my link is like this:

    <a href=index.php?page=kategorije/$row[id_cat]/$newname>{$row['name']}</a>
    

    $newname give "-" instead empty space between words.

    And this kind of link give me this url:

    www.mywebsite.com/index.php?page=category/3/The-Name-Of-Shop
    

    How to write .htaccess to get:

    www.mywebsite.com/The-Name-Of-Shop
    
    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论
查看更多回答(1条)

报告相同问题?

悬赏问题

  • ¥15 像这种代码要怎么跑起来?
  • ¥15 怎么改成循环输入删除(语言-c语言)
  • ¥15 安卓C读取/dev/fastpipe屏幕像素数据
  • ¥15 pyqt5tools安装失败
  • ¥15 mmdetection
  • ¥15 nginx代理报502的错误
  • ¥100 当AWR1843发送完设置的固定帧后,如何使其再发送第一次的帧
  • ¥15 图示五个参数的模型校正是用什么方法做出来的。如何建立其他模型
  • ¥100 描述一下元器件的基本功能,pcba板的基本原理
  • ¥15 STM32无法向设备写入固件