| | #1 |
| HyperActive Warrior Registered Member War Room Member Join Date: 2007 Location: , , .
Posts: 322
Thanks: 167
Thanked 31 Times in 30 Posts
|
If someone tries to access these abbreviated page-types, then a 404 error: http://getcityweather.com/international/region/na.html http://getcityweather.com/internatio...forecasts.html http://getcityweather.com/internatio...forecasts.html http://getcityweather.com/internatio...forecasts.html I had tried to use .htaccess file redirect [code] # redirect all non-www traffic #RewriteCond %{HTTP_HOST} ^region/\?\?\.html$ #RewriteRule ^region/??\.html$ http://www.google.com [R=permanent,L] #RewriteRule ^region/([A-Za-z]{2})\.html$ http://www.google.com [R=permanent,L] or this below code Redirect 301 /region/af.html http://www.getcityweather.com/us/ [\code] Some one please let me know, whether I should do it through .htaccess way or is there anything in php like catching the url and redirecting them. Please help it is little urgent. |
| |
| | #2 |
| I am developer I think so Join Date: 2013 Location: Ahemdabad
Posts: 8
Thanks: 0
Thanked 0 Times in 0 Posts
|
server { listen 80; server_name _; root /var/www/vhosts/$host/httpdocs/; error_page 404 /; location / { try_files $uri $uri/ /index.php; } location ~ \.php$ { try_files $uri =404; include fastcgi_params; fastcgi_index index.php; fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name; fastcgi_param PATH_INFO $fastcgi_script_name; #fastcgi_pass php; fastcgi_pass 127.0.0.1:9000; } location ~* \.(?:ico|css|js|gif|jpe?g|png)$ { expires max; add_header Pragma public; add_header Cache-Control "public, must-revalidate, proxy-revalidate"; } # this prevents hidden files (beginning with a period) from being served location ~ /\. { access_log off; log_not_found off; deny all; } } |
| |
| | #3 |
| HyperActive Warrior Registered Member War Room Member Join Date: 2007 Location: , , .
Posts: 322
Thanks: 167
Thanked 31 Times in 30 Posts
|
lol! is this is a php script or httaccess file? sorry bro, would you please put some light on it. Little description will be appreciated. I am looking for some html links not the php ones. Any how thanks a lot for stop by and put that great code here. |
| |
| | #4 |
| HyperActive Warrior Registered Member War Room Member Join Date: 2007 Location: , , .
Posts: 322
Thanks: 167
Thanked 31 Times in 30 Posts
|
Thanks guys for your response, I had sort out this thing by Mr. google. Oh here is my code for this file, which is working like a charm. Code: RewriteEngine On
RewriteRule (^region/[A-Za-z]{2}.html) - [F,L] ###/asdf [R,L] Once again thanks warriors for your time for providing such valuable help. I want to set best answer but I don't want to others to discourage for their efforts. |
| | |
| |
| | #5 |
| Graphics, PHP, .Net, Html War Room Member Join Date: 2011 Location: New York, NY
Posts: 2,176
Thanks: 199
Thanked 170 Times in 132 Posts
|
I'm sending you a PM now. Theres something wrong with the .html file you have set up. WILL - |
| WebDevelopmentGroup NYC & CA- Small Business Web Development, App Development, WordPress Development, Graphic Designs, Online Marketing, Local Marketing & more!. "Call us 1.800.219.1314 or message us!". Visit us today! "Now On Live Chat Mon-Fri.". www.WebDevelopmentGroup.org (Whitelable our Services) =================================== ==> #1 OFFLINE MARKETING FORUM ON THE WEB! <== www.OFFLINEMARKETINGFORUM.com (Register Now) | |
| |
|
| Bookmarks |
| Tags |
| 404, error, links, redirect |
| |