Log in

View Full Version : htacess issue



ankush
01-20-2014, 05:15 AM
Options +FollowSymLinks -MultiViews
RewriteEngine On
RewriteBase /
ErrorDocument 404 /404.shtml

RewriteRule profile/([a-zA-Z0-9\-]+)-([0-9]+) profile.php?name=$1&userid=$2
RewriteRule messages messages.php
RewriteRule view-wallpaper/([a-zA-Z0-9\-]+)-([0-9]+) view_wallpaper.php?title=$1&id=$2


Hi guys, i want to know if my htacess format is correct because i am facing an issue while generating xml sitemap for my website.

It is generating some url like this

http://mywebsite.com/view-wallpaper/view-wallpaper/view-wallpaper/wallpapername-2
http://mywebsite.com/view-wallpaper/view-wallpaper/wallpapername-3

but the correct format is below

http://mywebsite.com/view-wallpaper/wallpapername-2
http://mywebsite.com/view-wallpaper/wallpapername-3

ankush
01-23-2014, 12:19 PM
Please look into this, anyone?

traq
01-23-2014, 06:51 PM
Hi guys, i want to know if my htacess format is correct
If your htaccess file format was incorrect, you would get an Internal Server Error (500) when you visited your site.
This doesn't mean that it does what you expect, of course. If you type in one of your desired URLs (e.g., http://mywebsite.com/view-wallpaper/wallpapername-2), do you see the correct page?



… i am facing an issue while generating xml sitemap for my website.
htaccess files do not generate xml sitemaps. What program are you using to do this? How does it work? Most sitemap generators will simply follow all the internal links it finds on your site.

I would suggest searching your site for links like the ones you say are generated. The htaccess file you showed us is not responsible for this - it only generates internal redirects, which are transparent to the user (or bots, or sitemap generators). Is there another htaccess file somewhere on your site? or are there any rewrite rules in your site's apache configuration?

ankush
01-27-2014, 06:51 AM
If your htaccess file format was incorrect, you would get an Internal Server Error (500) when you visited your site.
This doesn't mean that it does what you expect, of course. If you type in one of your desired URLs (e.g., http://mywebsite.com/view-wallpaper/wallpapername-2), do you see the correct page?



htaccess files do not generate xml sitemaps. What program are you using to do this? How does it work? Most sitemap generators will simply follow all the internal links it finds on your site.

I would suggest searching your site for links like the ones you say are generated. The htaccess file you showed us is not responsible for this - it only generates internal redirects, which are transparent to the user (or bots, or sitemap generators). Is there another htaccess file somewhere on your site? or are there any rewrite rules in your site's apache configuration?

i am generating xml sitemap via some online generator
so my problem is that it is generating some url like this in xml sitemap


http://mywebsite.com/view-wallpaper/view-wallpaper/view-wallpaper/wallpapername-2

but the actual url is


http://mywebsite.com/view-wallpaper/wallpapername-2

so i am getting a 404 error for the above url

no, there are only 1 htacess

Beverleyh
01-27-2014, 08:53 AM
Can you confirm that the xml sitemap generation works fine when the htaccess file is temporarily disabled?

ankush
02-03-2014, 01:12 PM
i have tried to disable .htacess but then it is generating only homepage in xml sitemap.

i think the problem is with absolute url, i am changing all url


from wallpapers/wallpaper-name-123

to


http://mysite.com/wallpapers/wallpaper-name-123

i will let you know the updates.

ankush
02-26-2014, 12:38 PM
guys it is fixed by replacing the url from "somepage.php" to "mysite.com/somepage.php"

Thanks all