douhan9748 2011-03-09 14:30
浏览 22

重定向到主页面(索引)

I am building a website and I will need to make it SEO friendly so, as it is now, I am using a dynamic website (PHP) and through .htaccess, I am making it appear as if the site has static pages.

To do this, I am redirecting to a php file which then displays the content.

The url looks like: www.mainpage.dk/phpfile-navigationvalue-value.htm

I am using a navigation value inside the page to render it according to which menu item is clicked.

The guy I am building this for says that a url like www.mainpage/something.html is better for SEO purporses than www.mainpage.dk/phpfile-navigationvalue-value.htm. Can anyone come with some input on this matter?

And if the regular static page is better, is there a way to make a dynamic look just like a regular static page?

PS: The reason why I want a dynamic page is that the page is going to be extended with new pages every now and then as well as updated frequently.

  • 写回答

1条回答 默认 最新

  • dongweicha6077 2011-03-09 14:36
    关注

    To make it look like a regular page you could add *.html -> alias.php?alias=*

    Then check the aliases and display the proper page from PHP.

    Also, how about making it :

    www.mainpage.dk/phpfile/navvalue/value/ -> index.php?page=phpfile&nav=navvalue&val=value

    I would discourage redirecting to a phpfile, but handle it via index.php?page=* (look line above), or something similar.


    Edit:

    how htaccess should look

    RewriteEngine on
    #  [!]for `*.html` -> `alias.php?alias=*`
    RewriteRule ^(.*)\.html$ alias.php?alias=$1 [NC]
    #  [!]for `/phpfile/navvalue/value/` -> `index.php?page=phpfile&nav=navvalue&val=value`
    RewriteRule ^(.*)/(.*)/(.*)(/)?$ index.php?page=$1&nav=$2&val=$3 [NC]
    
    评论

报告相同问题?

悬赏问题

  • ¥20 关于多单片机模块化的一些问题
  • ¥30 seata使用出现报错,其他服务找不到seata
  • ¥35 引用csv数据文件(4列1800行),通过高斯-赛德尔法拟合曲线,在选取(每五十点取1点)数据,求该数据点的曲率中心。
  • ¥20 程序只发送0X01,串口助手显示不正确,配置看了没有问题115200-8-1-no,如何解决?
  • ¥15 Google speech command 数据集获取
  • ¥15 vue3+element-plus页面崩溃
  • ¥15 像这种代码要怎么跑起来?
  • ¥15 安卓C读取/dev/fastpipe屏幕像素数据
  • ¥15 pyqt5tools安装失败
  • ¥15 mmdetection