0

hey, it has been a couple of months since i have been here, and let's get strait to the point.

someone told me you can change the page title of a dynamic link with the .htaccess file.
for example i have a page.
http://www.mywebsite.com/page.php?id=1

i include this page for different links for example: about us, contact us, links page and home page on the foother of the page.
all the text is comming from the database and the title is static.
so everywhere i have www.mywebsite.com as title.
is it possible to change the title from each page?
like:
http://www.mywebsite.com/page.php?id=1 becomes test1
http://www.mywebsite.com/page.php?id=2 becomes test2
http://www.mywebsite.com/page.php?id=3 becomes test3
http://www.mywebsite.com/page.php?id=4 becomes test4

i hope this is clear else i have some more examples:

<html>
<title>www.mywebsite.com</title>
<ul>
            	<li><a href="page.php?id=1">about us</a></li>
                <li><a href="page.php?id=2">contact us</a></li>
                <li><a href="page.php?id=3">link page</a></li>
                <li><a href="page.php?id=4">home page</a></li>
</ul>
</html>

this is how it kinda looks with alot of code removed.
how do i get page.php?id=1 to show another title.

2
Contributors
1
Reply
3
Views
6 Years
Discussion Span
Last Post by smantscheff
1

You are confusing file names and page titles.
The page title which a browser shows is stored in the html <title> element.
You can redirect file names in the apache webserver using the redirect module (ModRewrite). If the redirect engine is installed and active and redirection is allowed for your .htaccess file and directory, then you can use .htaccess to redefine file names. Example:

RewriteEngine On
RewriteRule test1 page.php?id=1
RewriteRule test2 page.php?id=2

or more generally RewriteRule test([0-9]+) page.php?id=$1

This question has already been answered. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.