problem with htaccess redirect

Discussions about Apache mod Rewrite, .htaccess, Use, experiences ... URL Rewriting.

Moderator: Moderators

problem with htaccess redirect

Postby macnack » Sun Jul 02, 2006 9:09 am

Hello

I´ve a script on my site who make urls like
detektor.php?p=5
I include the script to mx as a block with new url like
index.php?page=14?p=5
actually htaccess rule
Code: Select all
rewriteRule ^detektor.php(.*)$ http://www.detektoreninfo.de/index.php?page=14$1 [R=301,L]

but I think the ?p=5 doesn´t work
macnack
PR1
PR1
 
Posts: 101
Joined: Tue Jun 20, 2006 7:01 am
Location: Germany

Advertisement

Postby dcz » Sun Jul 02, 2006 9:20 am

This is normal.

I moved this to Apache mod rewrite forum as it's more of a general mod Rewrite matter.

So you have got URLs like these :

index.php?page=14&p=5 not index.php?page=14?p=5

But the thing is why do you want to implement an HTTP 301 here, aren't you trying to URL rewrite those instead of just have them moved permanently ?

For example, if you had decided to use something like "detektorsxx.html" for this page, then you'd just have to use this rewriterule :

Code: Select all
rewriteRule ^detektors([0-9]*)\.html$ /index.php?page=14&$1 [QSA,L]


Which will make correspond detektorsxx.html to index.php?page=14&p=xx

The only thing left to be done here is to make sure from now on you only use the detektorsxx.html standard to build these URLs, can be hard coded (you can as well think of a switch in your coding, like if $mod_rewrite then detektorsxx.html else index.php?page=14&p=xx, with $mod_rewrite set to TRUE or FALSE early enough in the code).

It should be fairly doable since it's your custom code that will output links and needs to be tweaked for this purpose, the mxBB part should not be more difficult than just to edit the menu nav setting and change the main access link to the new standard and to do the same everywhere you posted links to this module.

++
Useful links :
SEO Forum || SEO Directory || SEO phpBB || Search
____________________

Liens Utiles :
Forum référencement || Annuaire référencement || Référencement phpBB || Recherche
dcz
Admin
Admin
 
Posts: 21238
Joined: Fri Apr 28, 2006 9:03 pm

Postby macnack » Sun Jul 02, 2006 11:12 am

I think you don´t understand me
I´ve include in htacces
Code: Select all
rewriteRule ^detektor.php(.*)$ http://www.detektoreninfo.de/index.php?page=14$1 [R=301,L]

because there are old links
but If I run url domain.de/detektor.php?p=6
it will redirect me to
domain.de/index.php?page=14
I missed the &p=6

That what you are told me (detektorsxx.html) is on my to do list :wink:
macnack
PR1
PR1
 
Posts: 101
Joined: Tue Jun 20, 2006 7:01 am
Location: Germany

Postby dcz » Sun Jul 02, 2006 5:12 pm

lol I understand now :lol:

Anyway, good hints it seems :D
Useful links :
SEO Forum || SEO Directory || SEO phpBB || Search
____________________

Liens Utiles :
Forum référencement || Annuaire référencement || Référencement phpBB || Recherche
dcz
Admin
Admin
 
Posts: 21238
Joined: Fri Apr 28, 2006 9:03 pm


Return to Apache mod Rewrite

 


  • Related topics
    Replies
    Views
    Last post

Who is online

Users browsing this forum: No registered users and 4 guests