News:

Bored?  Looking to kill some time?  Want to chat with other SMF users?  Join us in IRC chat or Discord

Main Menu

Pretty URLs

Started by SMFHacks.com Team, January 31, 2007, 10:56:43 AM

Previous topic - Next topic

Sono

Which value should I choose if I want the search engine to ignore the previous page - next page links? There is two choice in Google webmasters URL parameters:

1. Doesn't affect page content
2. Affect page content


As I understand it refers to the targer URLs with the '?prev_next=next#new' tag.
Maybe the 1.? In that case it will skip what it finds with the '?prev_next=next#new' tag and only consider the simple URL?

Ruriko

I am using Drupal 6 and SMF 1.x and I use nginx as my webserver. I can't seem to get pretty urls working. The urls are converted but when you click on the links it gets redirected to home page. here's my nginx config
server {
    server_name www.gorgeousanime.com gorgeousanime.com;
    access_log /srv/www/gorgeousanime.com/logs/access.log;
    error_log /srv/www/gorgeousanime.com/logs/error.log;
    root /srv/www/gorgeousanime.com/public_html;

        location ~ \.php$ {
                include fastcgi_params;
                fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
                fastcgi_intercept_errors on;
                fastcgi_pass unix:/var/run/php5-fpm.sock;
        }

location ~ /forum
{
        root /srv/www/gorgeousanime.com/public_html/;
        index index.php index.html;

        if (!-e $request_filename)
        {
                # actions
rewrite ^/(activate|admin|announce|ban|boardrecount|buddy|calendar|cleanperms)/?$ "/index.php?pretty;action=$1" last;
rewrite ^/(collapse|convertentities|convertutf8|coppa|deletemsg|detailedversion|display|dlattach)/?$ "/index.php?pretty;action=$1" last;
rewrite ^/(dumpdb|editpoll|editpoll2|featuresettings|featuresettings2|findmember|help|helpadmin)/?$ "/index.php?pretty;action=$1" last;
rewrite ^/(im|jsoption|jsmodify|lock|lockVoting|login|login2|logout)/?$ "/index.php?pretty;action=$1" last;
rewrite ^/(maintain|manageattachments|manageboards|managecalendar|managesearch|markasread|membergroups|mergetopics)/?$ "/index.php?pretty;action=$1" last;
rewrite ^/(mlist|modifycat|modifykarma|modlog|movetopic|movetopic2|news|notify)/?$ "/index.php?pretty;action=$1" last;
rewrite ^/(notifyboard|optimizetables|packageget|packages|permissions|pgdownload|pm|post)/?$ "/index.php?pretty;action=$1" last;
rewrite ^/(post2|postsettings|printpage|profile|profile2|quotefast|quickmod|quickmod2)/?$ "/index.php?pretty;action=$1" last;
rewrite ^/(recent|regcenter|register|register2|reminder|removetopic2|removeoldtopics2|removepoll)/?$ "/index.php?pretty;action=$1" last;
rewrite ^/(repairboards|reporttm|reports|requestmembers|search|search2|sendtopic|serversettings)/?$ "/index.php?pretty;action=$1" last;
rewrite ^/(serversettings2|smileys|smstats|spellcheck|splittopics|stats|sticky|theme)/?$ "/index.php?pretty;action=$1" last;
rewrite ^/(trackip|about:mozilla|about:unknown|unread|unreadreplies|viewErrorLog|viewmembers|viewprofile)/?$ "/index.php?pretty;action=$1" last;
rewrite ^/(verificationcode|vote|viewquery|who|\.xml)/?$ "/index.php?pretty;action=$1" last;

# boards + topics
rewrite ^/([-_!~*'()$a-zA-Z0-9]+)/[0-9]?/?$ /index.php?pretty%3Bboard=$1.0 last;
rewrite ^/([-_!~*'()$a-zA-Z0-9]+)/([0-9]*)/[0-9]?/?$ /index.php?pretty%3Bboard=$1.$2 last;
rewrite ^/([-_!~*'()$a-zA-Z0-9]+)/([-_!~*'()$a-zA-Z0-9]+)/[0-9]?/?$ /index.php?pretty%3Bboard=$1%3Btopic=$2.0 last;
rewrite ^/([-_!~*'()$a-zA-Z0-9]+)/([-_!~*'()$a-zA-Z0-9]+)/([0-9]*|msg[0-9]*|new)/[0-9]?/?$ /index.php?pretty%3Bboard=$1%3Btopic=$2.$3 last;
        }
}

#######################################################
### nginx.conf catch-all
#######################################################

client_max_body_size 75M;

gzip_static on;
gzip on;
gzip_comp_level 9;
gzip_types application/x-javascript text/css text/plain text/xml application/xml application/xml+rss text/javascript;

location ~ \.(gif|jpg|jpeg|png|tif|bmp|jpe)$ {

valid_referers server_names none blocked ~(pcwintech.com|google.|simpleportforwarding.com);

if ($invalid_referer) {

rewrite ^ http://$host/showimage?file=${uri} permanent;
}

}

location ~ \.(exe|zip|reg|vbs)$ {

valid_referers server_names none blocked ~(pcwintech.com|google.|simpleportforwarding.com);

if ($invalid_referer) {

rewrite ^ http://$host? permanent;
}

}


location = /favicon.ico {
log_not_found off;
access_log off;
}

location = /robots.txt {
allow all;
log_not_found off;
access_log off;
}

# This is mostly based on Drupal's stock .htaccess
location ~* ^.+(\.(txt|engine|inc|info|install|module|profile|po|sh|.*sql|theme|tpl(\.php)?|xtmpl)|code-style\.pl|/Entries.*|/Repository|/Root|/Tag|/Template)$ {
return 404;
}

# serve static files directly
location ~* ^.+\.(jpg|jpeg|gif|png|ico|swf|flv)$ {
access_log off;
expires 30d;
}

# Very rarely should these ever be accessed outside of your lan
location ~* \.(txt|log)$ {
allow 192.168.0.0/16;
deny all;
}

location ~ \..*/.*\.php$ {
return 403;
}

## Deny some crawlers
if ($http_user_agent ~* (HTTrack|HTMLParser|libwww) ) {
return 444;
}
## Deny certain Referers (case insensitive)
if ($http_referer ~* (poker|sex|girl) ) {
return 444;
}
## www. redirect
if ($host = 'pcwintech.com' ) {
rewrite ^/(.*)$ http://www.pcwintech.com/$1 permanent;
}


##
## required only when using purl, spaces & og for modules: ajax_comments, watcher and fasttoggle
## the /og path should be modified to match your default for og/purl URL for organic groups
##
location ~* ^/og {
rewrite ^/og\-(.*)/ajax_comments/(.*)$ /index.php?q=ajax_comments/$2 last;
rewrite ^/og\-(.*)/context/ajax-block-view$ /index.php?q=context/ajax-block-view last;
rewrite ^/og\-(.*)/comment/reply/(.*)\?reload=1$ /index.php?q=comment/reply/$2&reload=1 last;
rewrite ^/og\-(.*)/node/([0-9]+)/toggle/(.*)$ /index.php?q=node/$2/toggle/$3 last;
rewrite ^/og\-(.*)/node/([0-9]+)/edit\?(.*)$ /index.php?q=node/$2/edit?$3 last;
rewrite ^/og\-(.*)/user/([0-9]+)/watcher/toggle/(.*)$ /index.php?q=user/$2/watcher/toggle/$3 last;
rewrite ^/(.*)$ /index.php?q=$1 last;
}

## 6.x starts
location / {
deny 1.2.3.4;
deny 83.228.199.228;
deny 194.8.75.141;
deny 84.122.26.246;
deny 194.8.75.0/24;
deny 194.8.74.0/24;
#rewrite ^/(.*)/$ /$1 permanent; # remove trailing slashes - disabled
try_files $uri @cache;
}

location @cache {
if ( $request_method !~ ^(GET|HEAD)$ ) {
return 405;
}
if ($http_cookie ~ "DRUPAL_UID") {
return 405;
}
error_page 405 = @drupal;
add_header Expires "Tue, 24 Jan 1984 08:00:00 GMT";
add_header Cache-Control "must-revalidate, post-check=0, pre-check=0";
add_header X-Header "Boost Citrus 1.9";
charset utf-8;
try_files /cache/normal/$host${uri}_$args.html /cache/$host${uri}_$args.html @drupal;
}

location @drupal {
###
### now simplified to reduce rewrites
###
rewrite ^/(.*)$ /index.php?q=$1 last;
}

location ~* (/\..*|settings\.php$|\.(htaccess|engine|inc|info|install|module|profile|pl|po|sh|.*sql|theme|tpl(\.php)?|xtmpl)$|^(Entries.*|Repository|Root|Tag|Template))$ {
deny all;
}

location ~* /files/.*\.php$ {
return 444;
}
location ~* /themes/.*\.php$ {
return 444;
}

location ~ \.css$ {
if ( $request_method !~ ^(GET|HEAD)$ ) {
return 405;
}
if ($http_cookie ~ "DRUPAL_UID") {
return 405;
}
error_page 405 = @uncached;
access_log off;
expires max; #if using aggregator
add_header X-Header "Boost Citrus 2.1";
try_files /cache/perm/$host${uri}_.css /cache/$host${uri}_.css $uri =404;
}

location ~ \.js$ {
if ( $request_method !~ ^(GET|HEAD)$ ) {
return 405;
}
if ($http_cookie ~ "DRUPAL_UID") {
return 405;
}
error_page 405 = @uncached;
access_log off;
expires max; # if using aggregator
add_header X-Header "Boost Citrus 2.2";
try_files /cache/perm/$host${uri}_.js /cache/$host${uri}_.js $uri =404;
}

location ~ \.json$ {
if ( $request_method !~ ^(GET|HEAD)$ ) {
return 405;
}
if ($http_cookie ~ "DRUPAL_UID") {
return 405;
}
error_page 405 = @uncached;
access_log off;
expires max; # if using aggregator
add_header X-Header "Boost Citrus 2.3";
try_files /cache/normal/$host${uri}_.json /cache/$host${uri}_.json $uri =404;
}

location @uncached {
access_log off;
expires max; # max if using aggregator, otherwise sane expire time
}

location ~* /files/imagecache/ {
access_log off;
try_files $uri @drupal; #imagecache support - now it works
}

location ~* ^.+\.(jpg|jpeg|gif|png|ico)$ {
access_log off;
expires 30d;
try_files $uri =404;
}

location ~* \.xml$ {
if ( $request_method !~ ^(GET|HEAD)$ ) {
return 405;
}
if ($http_cookie ~ "DRUPAL_UID") {
return 405;
}
error_page 405 = @drupal;
add_header Expires "Tue, 24 Jan 1984 08:00:00 GMT";
add_header Cache-Control "must-revalidate, post-check=0, pre-check=0";
add_header X-Header "Boost Citrus 2.4";
charset utf-8;
types { }
default_type application/rss+xml;
try_files /cache/normal/$host${uri}_.xml /cache/normal/$host${uri}_.html /cache/$host${uri}_.xml $uri @drupal;
}

location ~* /feed$ {
if ( $request_method !~ ^(GET|HEAD)$ ) {
return 405;
}
if ($http_cookie ~ "DRUPAL_UID") {
return 405;
}
error_page 405 = @drupal;
add_header Expires "Tue, 24 Jan 1984 08:00:00 GMT";
add_header Cache-Control "must-revalidate, post-check=0, pre-check=0";
add_header X-Header "Boost Citrus 2.5";
charset utf-8;
types { }
default_type application/rss+xml;
try_files /cache/normal/$host${uri}_.xml /cache/normal/$host${uri}_.html /cache/$host${uri}_.xml $uri @drupal;
}

#######################################################
### nginx.conf catch-all
#######################################################
# imagecache needs to have php read any files that it's planning to manipulate
location ^~ /sites/default/files/imagecache/ {
     index  index.php index.html;
     # assume a clean URL is requested, and rewrite to index.php                                                                 
      if (!-e $request_filename) {
          rewrite  ^/(.*)$  /index.php?q=$1  last;
          break;
      }
}

# serve static files directly
location ~* ^.+.(jpg|jpeg|gif|css|png|js|ico)$ {
    access_log        off;
    expires           30d;
}
}

InfoStrides

Quote from: Sono on March 17, 2012, 04:13:26 PM
Which value should I choose if I want the search engine to ignore the previous page - next page links? There is two choice in Google webmasters URL parameters:

1. Doesn't affect page content
2. Affect page content


As I understand it refers to the targer URLs with the '?prev_next=next#new' tag.
Maybe the 1.? In that case it will skip what it finds with the '?prev_next=next#new' tag and only consider the simple URL?

Select 2. Affect page content

Under "Which URLs with this parameter should Googlebot crawl?"

Select "No URLs" to ignore the url formats....

Explore the whole scenario.

Sono

#6603
I would have some further question about proper management of my forum in Google Webmasters:

1. In my forum when I go to the list in a members profile, where their posts are listed, and click the title of a post, I am redirected to the URL of the topic the post was sent into, and automatically scrolled to the message post that I clicked on in the profile list. But at this point this can be seen at the end of the URL: /msg18/#msg18 . So practically Google indexes a topic page with the pure URL and with this ending added, but these two have the same content actually. I would like to block Google to index these /msg18/#msg18 endings. How can I do that? The problem is the number after 'msg' changes depending on what the number of the post is that you want to check.

2. There is a subdirectory in the forum: /recent/ for recent posts. Is it adviseable to block Google index its content? Basically the content is the same as of the posts, it is just the compilation of every new post. I fear it can result in duplicate content penalty if I let google index this subdirectory. How can I have it blocked?

3. I had these parameters by Google recognised and listed in the URL parameters section of the Google Webmaster Tools:

sel​ect​ed_​id
tid
sor​t
PHP​SES​SID
u
are​a
vie​wfo​rum
exp​and
col​lap​se

I had blocked these by selecting Google not no index the URLs along with these parameters. Is it okay? I have Pretty URL running, the topics and forums have static URLs, so I didn't see the use of these parameters. Or maybe some of these are significant for indexing?

trekkie2444

Is there a way to keep pretty URLs from rewriting things such as commas or exclamation points in URLs? Sometimes when pasting those it breaks links on websites.

vbgamer45

Community Suite for SMF - Take your forum to the next level built for SMF, Gallery,Store,Classifieds,Downloads,more!

SMFHacks.com -  Paid Modifications for SMF

Mods:
EzPortal - Portal System for SMF
SMF Gallery Pro
SMF Store SMF Classifieds Ad Seller Pro

shubha

I have delete the old url and rewrite it.

Now i again want the old url .How will i get back.

For ex-
www.yourdomain.com/live

After rewrite
www.yourdomain.co/lives

Now i want back to
www.yourdomain.com/live

How will i get ,i have delete the "live" and i am unable to add it.


Tomy Tran



mossite

I tried to install the pretty URL mod and i do not undertand how to go about -" rename example.htaccess to .htaccess" Where is that located ? is it through CP or through FTP.
Am new to this, i will appreciate if someone can help me to install pretty url especially "rename example.htaccess to .htaccess
Thanks
Greatness is Goodness

mossite

This pretty URL, i want to know a few big forum where it works perfectly. It seem not to be as good as it sounds
Greatness is Goodness

iwords

On a brand new install of SMF 2.0.2 and Pretty URLs 1.0 with no other mods installed, everything works as it should, but the error log shows the following error whenever I view the Pretty URLs Settings page:-

http://newforum/index.php?action=admin;area=pretty;sa=settings
8: Undefined index: pretty_bufferusecache
File: D:/Inetpub/wwwroot/newforum/Themes/default/languages/PrettyUrls.english.php (pretty_settings sub template - eval?)
Line: 84


I can't see any obvious reason for the error, particularly as the text label the error refers to ("Use caching instead of database table for PrettyUrls") appears just fine on the settings page.

Any ideas what's causing this?

vbgamer45

A missing language string? What language are you using?
Community Suite for SMF - Take your forum to the next level built for SMF, Gallery,Store,Classifieds,Downloads,more!

SMFHacks.com -  Paid Modifications for SMF

Mods:
EzPortal - Portal System for SMF
SMF Gallery Pro
SMF Store SMF Classifieds Ad Seller Pro

iwords

I'm using English.

The theme I'm using is a copy of Curve which doesn't have a language folder to start.  I tried copying the language folder from 'default' in case something was missing, but that doesn't solve it.

Seems strange that it complains about a missing string, but it still displays it OK on the page.

iwords

Quote from: iwords on April 03, 2012, 05:57:15 AM
On a brand new install of SMF 2.0.2 and Pretty URLs 1.0 with no other mods installed, everything works as it should, but the error log shows the following error whenever I view the Pretty URLs Settings page:-

http://newforum/index.php?action=admin;area=pretty;sa=settings
8: Undefined index: pretty_bufferusecache
File: D:/Inetpub/wwwroot/newforum/Themes/default/languages/PrettyUrls.english.php (pretty_settings sub template - eval?)
Line: 84


I can't see any obvious reason for the error, particularly as the text label the error refers to ("Use caching instead of database table for PrettyUrls") appears just fine on the settings page.

Any ideas what's causing this?

I've managed to resolve this myself.

This mod doesn't appear to have a default value for modSettings['pretty_bufferusecache'] and if one hasn't been explicitly set, it generates an error.

To fix, go to the Pretty URLs settings page, tick the box labelled 'Use caching instead of database table for PrettyUrls' and click 'Save Changes'.  Then untick the same box, and click Save Changes again.  Everything should work fine and the error should stop appearing.

mossite

when i enable pretty URL my edit board cannot open-is blank, but when i disable it, it work, what can i do to correct it so that edit board in admin can work with pretty URL enable
Thanks
Greatness is Goodness

mossite

my edit board not uploading when i edit pretty URL which is working perfectly. how can i fis this
Greatness is Goodness

InfoStrides

Quote from: Sono on March 21, 2012, 03:50:51 AM
I would have some further question about proper management of my forum in Google Webmasters:

1. In my forum when I go to the list in a members profile, where their posts are listed, and click the title of a post, I am redirected to the URL of the topic the post was sent into, and automatically scrolled to the message post that I clicked on in the profile list. But at this point this can be seen at the end of the URL: /msg18/#msg18 . So practically Google indexes a topic page with the pure URL and with this ending added, but these two have the same content actually. I would like to block Google to index these /msg18/#msg18 endings. How can I do that? The problem is the number after 'msg' changes depending on what the number of the post is that you want to check.

2. There is a subdirectory in the forum: /recent/ for recent posts. Is it adviseable to block Google index its content? Basically the content is the same as of the posts, it is just the compilation of every new post. I fear it can result in duplicate content penalty if I let google index this subdirectory. How can I have it blocked?

3. I had these parameters by Google recognised and listed in the URL parameters section of the Google Webmaster Tools:

sel​ect​ed_​id
tid
sor​t
PHP​SES​SID
u
are​a
vie​wfo​rum
exp​and
col​lap​se

I had blocked these by selecting Google not no index the URLs along with these parameters. Is it okay? I have Pretty URL running, the topics and forums have static URLs, so I didn't see the use of these parameters. Or maybe some of these are significant for indexing?

Just create a new parameters like 'msg'. Google will not index any url with msg....

InfoStrides

Quote from: InfoStrides on March 14, 2012, 12:33:17 PM
I have problem with URL in the Sitemap.

I received alerts on my Google Webmaster as follows:

Quote
Invalid URL

This is not a valid URL. Please correct it and resubmit.

URL: /nigeria-news/
Parent tag: url
Tag: loc

When I checked my sitemap, the errors were confirmed. See it here: http://www.theinfostrides.com/sitemap/?xml

Also in the screenshot attached....

What should I do?

I am still helpless here... Any help?

InfoStrides

Now, I confirmed there is problem somewhere.... The same error occur in RSS feed when I switch on pretty-URLS.

The domain name (http://www.theinfostrides.com) is removed from the URL and only return (/african-news/kenya-tanzania-issue-tsunami-warnings/msg91048/#msg91048)


Advertisement: