• Gangkast
  • Registratie: Juni 2001
  • Niet online

Gangkast

/// Meubel

Topicstarter
Ik heb mijn dynamische php site vervangen door een site met een cms,
eerst was de oude url voor de pagina 'test': www.mysite.com/?q=test
nu is het www.mysite.com/test/ geworden.

Voor de redirect wil ik een perm 301 gebruiken via de .htaccess

nu stond er al in (doordat de cms alles naar de index.php stuurt:

code:
1
2
3
4
5
# Catch all requests
RewriteRule ^$ index.php?uri= [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ index.php?uri=$1


Om te redirect te maken heb ik er dit van gemaakt:

code:
1
2
3
4
5
6
7
8
9
RewriteBase /
RewriteCond %{QUERY_STRING} [&]?q=test[&]?
RewriteRule ^/$ http://www.mysite.com/test/? [R=301,L]

# Catch all requests
RewriteRule ^$ index.php?uri= [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ index.php?uri=$1


ik heb verschillende manieren geprobeerd, maar telkens krijg ik de 'gewone' nieuwe index page.

“The world is a book and those who do not travel read only one page”


  • Janoz
  • Registratie: Oktober 2000
  • Laatst online: 14:25

Janoz

Moderator Devschuur®

!litemod

Zie Waar hoort mijn topic?

.htaccess tropics horen niet thuis in PRG

Ken Thompson's famous line from V6 UNIX is equaly applicable to this post:
'You are not expected to understand this'


  • Gangkast
  • Registratie: Juni 2001
  • Niet online

Gangkast

/// Meubel

Topicstarter
Solved!

het werkt nu met deze:
RewriteBase /
RewriteCond %{QUERY_STRING} ^q=testtest$
RewriteRule ^$ http://www.mysite.com/testtest/? [R=301,L]

“The world is a book and those who do not travel read only one page”