For example, in subsilver2 based styles (like i use); when i view a topic page, there are "previous topic" and "next topic" links at the top right of the first message which helps to navigate between the topics in the current forum. If there is no previous or next topic, a message is displayed telling "There are no newer topics in this forum."
I don't know SEO, Google indexing and such things very well but isn't it cause duplicate pages?
For example; when i click previous from a topic, it opens this URL: localhost/phpbb/viewtopic.php?f=2&t=6&view=previous which is topic5. When i open topic5 in the forum by directly clicking, its URL is localhost/phpbb/ilk-forumunuz/topic5.html which is my preference to be indexed by search engines.
So there are two URLs, which will be indexed by Google and they have the same content. Also, Google will index some of my forum URLs that have "?" and "&" in it which i don't want.
Without redirection, how can i handle this problem? Also, i want to rewrite the URLs with "?". For example,
localhost/phpbb/viewtopic.php?f=2&t=6&view=previous should be sth. like localhost/phpbb/viewtopic/f2-t6/viewprevious.html
I have learned how to define RewriteRule in .htaccess. I think sth. like;
- Code: Select all
RewriteRule ^phpbb/viewtopic-f(.*)-t(.*)-view(.*)\.html$ /phpbb/viewtopic.php?f=$1&t=$2&view=$3 [QSA,L,NC]
Can you show me a way that how i can rewrite a URL with all necessary things? If you tell me on my example, it will be perfect but you can also give another example which can be reference for people like me that wants to make self URL rewritings.
I think preg_replace php function is used for rewriting, but still, i can't figure out totally how it works and above all, how can i use this rewritten URL and tell the phpbb to use it rather than the first one?