Problems, need help? Have a tip or advice? Post it here.
10 posts Page 1 of 1
Hi I have used wordpress before and now updated to couchcms... I recreated new pages for the pages which were created in wordpress.. so i redirected those previous wordpress urls to new urls.. all were redirecting to new pages perfectly except few of urls are redirecting to the new page but what i can see is path url is something like this in browser when i type the old url in browser ..

hollywood/killing-them-softly-movie.html?fname=killing-them-softly-movie

and this is not case with all urls i redirected.. only few are showing like this .. I checked few other urls dey were fine in redirecting.. I dont understnd y the part ?fname= .. is displaying..
what might be the problem?
Could you please let me know how exactly you have setup the redirection to occur?
Thanks.
I just wrote a simple line in .htaccess file like this :

redirect /path-of-old-url/ http://domain.com/new-url.html
Can you please paste in your complete .htaccess file?
The reason for the problem has to be in it somewhere.
Code: Select all
Options +Indexes +FollowSymlinks -MultiViews
<IfModule mod_rewrite.c>
RewriteEngine On

#If your website is installed in a subfolder, change the line below to reflect the path to the subfolder.
#e.g. for http://www.example.com/subdomain1/subdomain2/ make it RewriteBase /subdomain1/subdomain2
RewriteBase /

#If you wish to use a custom 404 page, place a file named 404.php in your website's root and uncomment the line below.
#If your website is installed in a subfolder, change the line below to reflect the path to the subfolder.
#e.g. for http://www.example.com/subdomain1/subdomain2/ make it ErrorDocument 404 /subdomain1/subdomain2/404.php
#ErrorDocument 404 /404.php

#If your site begins with 'www', uncomment the following two lines
#RewriteCond %{HTTP_HOST} !^www\.
#RewriteRule ^(.*)$ http://www.%{HTTP_HOST}/$1 [R=301,L]


#DO NOT EDIT BELOW THIS


RewriteCond %{REQUEST_FILENAME} -d [OR]
RewriteCond %{REQUEST_FILENAME} -f
RewriteRule . - [L]

#tollywood.php
RewriteRule ^tollywood$ "$0/" [R=301,L,QSA]
RewriteRule ^tollywood/$ tollywood.php [L,QSA]
RewriteRule ^tollywood/.*?([^\.\/]*)\.html$ tollywood.php?pname=$1 [L,QSA]
RewriteRule ^tollywood/([1-2]\d{3})/(?:(0[1-9]|1[0-2])/(?:(0[1-9]|1[0-9]|2[0-9]|3[0-1])/)?)?$ tollywood.php?d=$1$2$3 [L,QSA]
RewriteRule ^tollywood/[^\.]*?([^/\.]*)/$ tollywood.php?fname=$1 [L,QSA]
RewriteRule ^tollywood/[^\.]*?([^/\.]*)$ "$0/" [R=301,L,QSA]

#tennis.php
RewriteRule ^tennis$ "$0/" [R=301,L,QSA]
RewriteRule ^tennis/$ tennis.php [L,QSA]
RewriteRule ^tennis/.*?([^\.\/]*)\.html$ tennis.php?pname=$1 [L,QSA]
RewriteRule ^tennis/([1-2]\d{3})/(?:(0[1-9]|1[0-2])/(?:(0[1-9]|1[0-9]|2[0-9]|3[0-1])/)?)?$ tennis.php?d=$1$2$3 [L,QSA]
RewriteRule ^tennis/[^\.]*?([^/\.]*)/$ tennis.php?fname=$1 [L,QSA]
RewriteRule ^tennis/[^\.]*?([^/\.]*)$ "$0/" [R=301,L,QSA]

#sports.php
RewriteRule ^sports$ "$0/" [R=301,L,QSA]
RewriteRule ^sports/$ sports.php [L,QSA]
RewriteRule ^sports/.*?([^\.\/]*)\.html$ sports.php?pname=$1 [L,QSA]
RewriteRule ^sports/([1-2]\d{3})/(?:(0[1-9]|1[0-2])/(?:(0[1-9]|1[0-9]|2[0-9]|3[0-1])/)?)?$ sports.php?d=$1$2$3 [L,QSA]
RewriteRule ^sports/[^\.]*?([^/\.]*)/$ sports.php?fname=$1 [L,QSA]
RewriteRule ^sports/[^\.]*?([^/\.]*)$ "$0/" [R=301,L,QSA]

#hollywood.php
RewriteRule ^hollywood$ "$0/" [R=301,L,QSA]
RewriteRule ^hollywood/$ hollywood.php [L,QSA]
RewriteRule ^hollywood/.*?([^\.\/]*)\.html$ hollywood.php?pname=$1 [L,QSA]
RewriteRule ^hollywood/([1-2]\d{3})/(?:(0[1-9]|1[0-2])/(?:(0[1-9]|1[0-9]|2[0-9]|3[0-1])/)?)?$ hollywood.php?d=$1$2$3 [L,QSA]
RewriteRule ^hollywood/[^\.]*?([^/\.]*)/$ hollywood.php?fname=$1 [L,QSA]
RewriteRule ^hollywood/[^\.]*?([^/\.]*)$ "$0/" [R=301,L,QSA]

#bollywood.php
RewriteRule ^bollywood$ "$0/" [R=301,L,QSA]
RewriteRule ^bollywood/$ bollywood.php [L,QSA]
RewriteRule ^bollywood/.*?([^\.\/]*)\.html$ bollywood.php?pname=$1 [L,QSA]
RewriteRule ^bollywood/([1-2]\d{3})/(?:(0[1-9]|1[0-2])/(?:(0[1-9]|1[0-9]|2[0-9]|3[0-1])/)?)?$ bollywood.php?d=$1$2$3 [L,QSA]
RewriteRule ^bollywood/[^\.]*?([^/\.]*)/$ bollywood.php?fname=$1 [L,QSA]
RewriteRule ^bollywood/[^\.]*?([^/\.]*)$ "$0/" [R=301,L,QSA]
</IfModule>

redirect /looper-movie/ http://evaspelunker.com/hollywood/looper-movie.html

redirect /hollywood/bel-borba-aqui-movie/  http://evaspelunker.com/hollywood/bel-borba-aqui-movie.html

redirect /hollywood/just-45-minutes-from-broadway-movie/ http://evaspelunker.com/hollywood/just-45-minutes-from-broadway-movie.html

redirect /hollywood/killing-them-softly-movie/ http://evaspelunker.com/hollywood/killing-them-softly-movie.html

redirect /hollywood/now-forager-movie/ http://evaspelunker.com/hollywood/now-forager-movie.html

------------------------------------------------------------

In the above code if you check looper movie the redirection has no problems. But in the other urls holllywood is category created in wordpress.. And to not miss the path I have created same folders with couch too .. so is that what causing problem?
Please try placing the redirection directives before the Couch specific directives i.e. place them just before the following line
#DO NOT EDIT BELOW THIS

Do let me know if this helps.
Hi, seem to be getting the same problem as well, seems to be appending ?fname to the url, i have it above the #DO NOT EDIT BELOW THIS line in the .htaccess file, but that doesn't seem to fix the issue, wondering if you solved the above issue somehow?

URL produced would be: http://www.blink-182.co.uk/tour-dates/? ... r-20092010
Would like it to get rid of the ?fname parameter if possible.

my .htaccess file looks like:

Code: Select all
Options +Indexes +FollowSymlinks -MultiViews
<IfModule mod_rewrite.c>
RewriteEngine On

#If your website is installed in a subfolder, change the line below to reflect the path to the subfolder.
#e.g. for http://www.example.com/subdomain1/subdomain2/ make it RewriteBase /subdomain1/subdomain2
RewriteBase /

#If you wish to use a custom 404 page, place a file named 404.php in your website's root and uncomment the line below.
#If your website is installed in a subfolder, change the line below to reflect the path to the subfolder.
#e.g. for http://www.example.com/subdomain1/subdomain2/ make it ErrorDocument 404 /subdomain1/subdomain2/404.php
ErrorDocument 404 /404.php

#If your site begins with 'www', uncomment the following two lines
RewriteCond %{HTTP_HOST} !^www\.
RewriteRule ^(.*)$ http://www.%{HTTP_HOST}/$1 [R=301,L]

# Turn on Expires and set default to 0
ExpiresActive On
ExpiresDefault A0

# Set up caching on media files for 1 year (forever?)
<FilesMatch "\.(flv|ico|pdf|avi|mov|ppt|doc|mp3|wmv|wav)$">
ExpiresDefault A604800
Header append Cache-Control "public"
</FilesMatch>

# Set up caching on media files for 1 week
<FilesMatch "\.(gif|jpg|jpeg|png|swf)$">
ExpiresDefault A604800
Header append Cache-Control "public"
</FilesMatch>

# Set up 2 Hour caching on commonly updated files
<FilesMatch "\.(txt|js)$">
ExpiresDefault A604800
Header append Cache-Control "proxy-revalidate"
</FilesMatch>

# Set up 2 Hour caching on commonly updated files
<FilesMatch "\.(xml|html|css)$">
ExpiresDefault A7200
Header append Cache-Control "proxy-revalidate"
</FilesMatch>

# Force no caching for dynamic files
<FilesMatch "\.(php|cgi|pl|htm)$">
ExpiresActive Off
Header set Cache-Control "private, no-cache, no-store, proxy-revalidate, no-transform"
Header set Pragma "no-cache"
</FilesMatch>

Redirect 301 http://www.blink-182.co.uk/blink-182-uk-tour-20092010 http://www.blink-182.co.uk/tour-dates/
Redirect 301 /band-news/blink-182-sneak-peak-of-summer-tour/ http://www.blink-182.co.uk/tour-dates/
Redirect 301 /jedward-cover-all-the-small-things-and-touring-with-blink-this-summer/ http://www.blink-182.co.uk/tour-dates/
Redirect 301 /blink-182-tour-dates-more-live-photos/ http://www.blink-182.co.uk/tour-dates/
Redirect 301 /blink-182-uk-tour-20092010/ http://www.blink-182.co.uk/tour-dates/
Redirect 301 /band-news/rescheduled-tour-dates/ http://www.blink-182.co.uk/tour-dates/
Redirect 301 /band-news/blink-182-weezer-tour/ http://www.blink-182.co.uk/tour-dates/
Redirect 301 /euro-tour-2010/ http://www.blink-182.co.uk/tour-dates/
Redirect 301 /blink-182-uk-tour-20092010/ http://www.blink-182.co.uk/tour-dates/
Redirect 301 /tour-2009/blink-182-uk-tour-20092010/ http://www.blink-182.co.uk/tour-dates/
Redirect 301 /band-news/blink-182-tour-openers-mtv-article/ http://www.blink-182.co.uk/tour-dates/
Redirect 301 /blink-182-tour-openers-mtv-article/ http://www.blink-182.co.uk/tour-dates/

#DO NOT EDIT BELOW THIS

RewriteRule ^videos/index.php$ "videos/" [R=301,L,QSA]
RewriteRule ^the-band/index.php$ "the-band/" [R=301,L,QSA]
RewriteRule ^news/index.php$ "news/" [R=301,L,QSA]
RewriteRule ^index.php$ "" [R=301,L,QSA]

RewriteCond %{REQUEST_FILENAME} -d [OR]
RewriteCond %{REQUEST_FILENAME} -f
RewriteRule . - [L]

#videos/index.php
RewriteRule ^videos/.*?([^\.\/]*)\.html$ videos/?pname=$1 [L,QSA]
RewriteRule ^videos/([1-2]\d{3})/(?:(0[1-9]|1[0-2])/(?:(0[1-9]|1[0-9]|2[0-9]|3[0-1])/)?)?$ videos/?d=$1$2$3 [L,QSA]
RewriteRule ^videos/[^\.]*?([^/\.]*)/$ videos/?fname=$1 [L,QSA]
RewriteRule ^videos/[^\.]*?([^/\.]*)$ "$0/" [R=301,L,QSA]

#the-band/index.php
RewriteRule ^the-band/.*?([^\.\/]*)\.html$ the-band/?pname=$1 [L,QSA]
RewriteRule ^the-band/([1-2]\d{3})/(?:(0[1-9]|1[0-2])/(?:(0[1-9]|1[0-9]|2[0-9]|3[0-1])/)?)?$ the-band/?d=$1$2$3 [L,QSA]
RewriteRule ^the-band/[^\.]*?([^/\.]*)/$ the-band/?fname=$1 [L,QSA]
RewriteRule ^the-band/[^\.]*?([^/\.]*)$ "$0/" [R=301,L,QSA]

#news/index.php
RewriteRule ^news/.*?([^\.\/]*)\.html$ news/?pname=$1 [L,QSA]
RewriteRule ^news/([1-2]\d{3})/(?:(0[1-9]|1[0-2])/(?:(0[1-9]|1[0-9]|2[0-9]|3[0-1])/)?)?$ news/?d=$1$2$3 [L,QSA]
RewriteRule ^news/[^\.]*?([^/\.]*)/$ news/?fname=$1 [L,QSA]
RewriteRule ^news/[^\.]*?([^/\.]*)$ "$0/" [R=301,L,QSA]

#index.php
RewriteRule ^.*?([^\.\/]*)\.html$ ?pname=$1 [L,QSA]
RewriteRule ^([1-2]\d{3})/(?:(0[1-9]|1[0-2])/(?:(0[1-9]|1[0-9]|2[0-9]|3[0-1])/)?)?$ ?d=$1$2$3 [L,QSA]
RewriteRule ^[^\.]*?([^/\.]*)/$ ?fname=$1 [L,QSA]
RewriteRule ^\w[^\.]*?([^/\.]*)$ "$0/" [R=301,L,QSA]
</IfModule>
Hi @roshea89,

Frankly I couldn't make out, looking at the .htaccess rules alone, as to what could be appending the '?fname=blink-182-uk-tour-20092010' to the URL.
The rewrite rules used by Couch further down do add such a parameter but that all happens internally - i.e. the URL gets 'rewritten' but the change is never reflected in the address bar.

Maybe someone more adept with URL rewriting would be able to spot something out-of-place.

Sorry, couldn't be of much help to you.
Instead of for example
Code: Select all
Redirect 301 /blink-182-tour-openers-mtv-article/ http://www.blink-182.co.uk/tour-dates/
please try
Code: Select all
RewriteRule ^blink-182-tour-openers-mtv-article/$ "tour-dates/" [R=301,L,QSA]
This should work because we set the L (last) flag and thus no more rules will be processed. If not, then change [R=301,L,QSA] to [R=301,L].

Do remember that since these are 301 redirects, browsers will temporarily cache the result. Please restart your browser between tests.
Thanks for the help KK and cheesypoof, replaced my rule with the Rewrite one as suggested and works nicely. Thanks again.
10 posts Page 1 of 1
cron