Table of Contents
回复讨论(解决方案)
Home Backend Development PHP Tutorial 网站更换的问题

网站更换的问题

Jun 23, 2016 pm 02:02 PM

现在公司重新做了一个网站,以前的新闻部整合到了新网站里面,但以前的旧新闻链接要保留,并且点击旧新闻的时候要指向新的网站,这个要怎么做,需要配置.htaccess吗?


回复讨论(解决方案)

是的,配置302转向

是的,配置302转向

这个具体怎么设置呢?

比如:旧网站:http://www.zh123.com/salaryandcareertips/2034/detail/

      新网站:http://news.zh123.com/news-2034/

2032是id的话
salaryandcareertips\/(0-9+)\/detail\/  news-$1/

RewriteRule salaryandcareertips\/(0-9+)\/detail\/  news-$1/ [L,R=301]

RewriteRule salaryandcareertips\/(0-9+)\/detail\/  news-$1/ [L,R=301]

好的,谢谢,我星期六试试

RewriteRule salaryandcareertips\/(0-9+)\/detail\/  news-$1/ [L,R=301]

我在我们网站里面发现了.htaccess文件,里面有一些
RewriteRule ^heighlights/([0-9]+)/([a-zA-Z0-9_]+)/$ /modules/heighlights/heighlight-details.php?id=$1&pagetype=$2 [QSA,L]

#RewriteRule ^employer/([0-9]+)/([a-zA-Z0-9_]+)-detail/$ /modules/employers/employer-details.php?id=$1&pagetype=$2 [QSA,L]

这2句是什么意思?



简单点就是:  /modules/heighlights/heighlight-details.php?id=1&pagetype=2 这样的链接
重写为:heighlights/1/2
 /modules/employers/employer-details.php?id=1&pagetype=2
重写为:employer/1/2

Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn

Hot Article

Hot tools Tags

Notepad++7.3.1

Notepad++7.3.1

Easy-to-use and free code editor

SublimeText3 Chinese version

SublimeText3 Chinese version

Chinese version, very easy to use

Zend Studio 13.0.1

Zend Studio 13.0.1

Powerful PHP integrated development environment

Dreamweaver CS6

Dreamweaver CS6

Visual web development tools

SublimeText3 Mac version

SublimeText3 Mac version

God-level code editing software (SublimeText3)

11 Best PHP URL Shortener Scripts (Free and Premium) 11 Best PHP URL Shortener Scripts (Free and Premium) Mar 03, 2025 am 10:49 AM

11 Best PHP URL Shortener Scripts (Free and Premium)

Working with Flash Session Data in Laravel Working with Flash Session Data in Laravel Mar 12, 2025 pm 05:08 PM

Working with Flash Session Data in Laravel

6 Extra Skills Every PHP Developer Should Have 6 Extra Skills Every PHP Developer Should Have Feb 28, 2025 am 10:52 AM

6 Extra Skills Every PHP Developer Should Have

Understand Arrays in PHP Understand Arrays in PHP Feb 28, 2025 am 10:53 AM

Understand Arrays in PHP

Build a React App With a Laravel Back End: Part 2, React Build a React App With a Laravel Back End: Part 2, React Mar 04, 2025 am 09:33 AM

Build a React App With a Laravel Back End: Part 2, React

Simplified HTTP Response Mocking in Laravel Tests Simplified HTTP Response Mocking in Laravel Tests Mar 12, 2025 pm 05:09 PM

Simplified HTTP Response Mocking in Laravel Tests

cURL in PHP: How to Use the PHP cURL Extension in REST APIs cURL in PHP: How to Use the PHP cURL Extension in REST APIs Mar 14, 2025 am 11:42 AM

cURL in PHP: How to Use the PHP cURL Extension in REST APIs

12 Best PHP Chat Scripts on CodeCanyon 12 Best PHP Chat Scripts on CodeCanyon Mar 13, 2025 pm 12:08 PM

12 Best PHP Chat Scripts on CodeCanyon

See all articles