The following warnings occurred:
Warning [2] Undefined array key "threadviews_countguests" - Line: 745 - File: showthread.php PHP 8.1.31 (Linux)
File Line Function
/inc/class_error.php 153 errorHandler->error
/showthread.php 745 errorHandler->error_callback
Warning [2] Undefined array key "allowautourl" - Line: 584 - File: inc/class_parser.php PHP 8.1.31 (Linux)
File Line Function
/inc/class_error.php 153 errorHandler->error
/inc/class_parser.php 584 errorHandler->error_callback
/inc/class_parser.php 228 postParser->parse_mycode
/inc/functions_post.php 830 postParser->parse_message
/showthread.php 916 build_postbit
Warning [2] Undefined property: MyLanguage::$thread_modes - Line: 46 - File: showthread.php(1650) : eval()'d code PHP 8.1.31 (Linux)
File Line Function
/inc/class_error.php 153 errorHandler->error
/showthread.php(1650) : eval()'d code 46 errorHandler->error_callback
/showthread.php 1650 eval




Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Rewrite for a single page url?
#1
Hello,

I would like to make a 301 redirection via .htaccess file for one single page.

My rewrite rules at the moment are:

Code:
<IfModule mod_rewrite.c>
    RewriteEngine on

    # Usually RewriteBase is just '/', but
    # replace it with your subdirectory path
    # RewriteBase /getsimple/
     RewriteBase /

    # Rewrite www
    RewriteCond %{HTTP_HOST} !^www\. [NC]
    RewriteRule ^(.*)$ http://www.%{HTTP_HOST}/$1 [R=301,L]
    
    # without .html
    RewriteRule ^(.*)\.html$ $1 [R=301,L]
    
    RewriteRule ^folder/oldpagename http://www.domainname.de/folder/newpagename [R=301,L] # how??
    RewriteRule ^oldfolder http://www.domainname.de/newfolder [R=301,L]
    RewriteRule ^blog/tag/?$ /blog [R=301,L]
    RewriteRule ^blog/post/?$ blog [R=301,L]
    
    # News Manager:
    RewriteRule ^blog/tag/([^/.]+)/page/([^/.]+)/?$ index.php?id=blog&tag=$1&page=$2 [L]
    RewriteRule ^blog/tag/([^/.]+)/?$ index.php?id=blog&tag=$1 [L]
    RewriteRule ^blog/post/([^/.]+)/?$ index.php?id=blog&post=$1 [L]
    RewriteRule ^blog/page/([^/.]+)/?$ index.php?id=blog&page=$1 [L]
    RewriteRule ^blog/archive/([^/.]+)/?$ index.php?id=blog&archive=$1 [L]
    # end News Manager
    
    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteCond %{REQUEST_FILENAME} !-d
     RewriteRule /?([A-Za-z0-9_-]+)/?$ index.php?id=$1 [QSA,L]
    

    RewriteRule ^data/uploads/(.*)$ plugins/download_interceptor/intercept.php?file=$1 [L]
    
</IfModule>

But the line with ...oldpagename ...newpagename does not work. What am I doing wrong?

The other redirections are for urls without .html and for urls always with www and other stuff.

Bye
Hypertexter


Wow, seems to work with:


Code:
RewriteRule ^blog/post/oldpagename/?$ $1/blog/post/newpagename [R=301,L]

Angel
But it was trial and error - with a phase of a frozen Firefox or server, where no redirection worked any more, very funny.

Does anybody know a good introduction into the syntax of .htaccess for beginners? I just found a lot of "do this" without further explanations.
Reply


Messages In This Thread
Rewrite for a single page url? - by Hypertexter - 2015-10-02, 17:19:27
RE: Rewrite for a single page url? - by jigarkhan - 2015-10-13, 02:39:56
RE: Rewrite for a single page url? - by datiswous - 2015-10-16, 00:36:45
RE: Rewrite for a single page url? - by shawn_a - 2015-10-16, 04:29:30
RE: Rewrite for a single page url? - by Carlos - 2015-10-20, 04:29:01
RE: Rewrite for a single page url? - by Carlos - 2015-10-22, 01:27:57
RE: Rewrite for a single page url? - by Nfcms - 2015-10-26, 20:36:21



Users browsing this thread: 2 Guest(s)