View Full Version : Something to remember
You may have heard the old saying that, "He couldn't see the forest for the trees", and in my case that was true. In order to get the mod_rewrite functions to work properly I was missing three important things
1) The eSyndicat .htaccess file provided in the downloaded package because it was "hidden" (best if it were re-named and re-zipped)
2) Any idea about how to modify said .htaccess file so that the mod_rewrite capabilities within eSyndicat could work.
3) Patience! After so many hours behind the keyboard I didn't have any left.
Through trial and error, and error, and error... it wasn't as difficult as it appeared (isn't that usually the case), but if you didn't "know" then where do you look first?
I didn't want the directory to sit at the "root" of my domain so created a /dir directory to keep things orderly. What needed to be done, and something I didn't see, was to add the RewriteBase line. More importantly it's necessary to give it the directory where it's installed, namely in my case /dir , it could be whatever name you chose to put it in like /lookatme or if you are putting it in root of your domain then a RewriteBase / .
To think I spent hours trying to make the basic / work over and over while failing, because that's what I've been reading in so many places. It's what is "assumed" and it's a mistake to assume anything.
# enable mod_rewrite
RewriteEngine on
RewriteBase /dir
Once the above was done, and the mod_rewrite enabled in eSyndicat configuration panel, everything works like it should, and those SEF - Search Engine Friendly - names you keep hearing about show up. It could be different for different hosts etc., I'm not claiming it'll work for everyone, but if you're having difficulties with this then check it out.
Luckyjj842
08-17-2007, 12:03 AM
Good work Mot,
I think I have the same issue hence I currently dont have those SEF - Search Engine Friendly - names. Infact the Google listing for my site is useless!! Lots of entries but no useful text less for the title.
Newspapergroup (http://www.newspapergroup.co.uk)
I have just tried your suggested changes - Alas, it was not to be!!
I am hosted with 1&1 and I think they may be the issue rather than the software. I have posed this question on lots of occasions on Esyndicat, and to date I have had no Positive Answers.
Currently my .htaccess file reads:
# enable mod_rewrite
RewriteEngine on
If anyone can assist or advise it would be appreciated.
John
I have done the same as yourself and placed ESyndicate in a folder called /dir
Currently my .htaccess file reads:
# enable mod_rewrite
RewriteEngine on
I'm with 1and1 as well. I had numerous email messages with their tech support and they didn't tell me much that I didn't figure out by myself. What I found out was by accident.
I used the .htaccess file as provided by eSyndicat (use your ftp client and look inside the original folder you unzipped from them and make sure you have your settings set to "show invisible files") or copy what I pasted below because that's the same thing but for what I added in red. Giving it the RewriteBase /dir made all the difference. And obviously if you had it in the root directory you'd simply change the /dir, or whatever, to /
I've heard people using CMS systems like Drupal etc. with 1and1 claim you had to fiddle with files and place /'s ahead of certain files etc., but that isn't necessary with this directory system.
# enable mod_rewrite
RewriteEngine on
RewriteBase /dir
# correct urls for yahoo bot
RewriteCond %{REQUEST_URI} !\..+$
RewriteCond %{REQUEST_URI} !/$
RewriteRule (.*) %{REQUEST_URI}/ [R=301,L]
# mod_rewrite rules for categories pages
RewriteRule ^(.*)/$ index.php?category=$1 [QSA,L]
RewriteRule ^(.*)/index([0-9]+).html$ index.php?category=$1&page=$2 [QSA,L]
# mod_rewrite rule for suggest link page
RewriteRule ^suggest-link([0-9]+).html$ suggest-link.php?id=$1 [QSA,L]
# mod_rewrite rule for suggest link page
RewriteRule report-link.php$ report-link.php [QSA,L]
RewriteRule ^([a-z]+)-links.html$ listings.php?view=$1 [QSA,L]
RewriteRule ^([a-z]+)-links([0-9]+).html$ listings.php?view=$1&page=$2 [QSA,L]
# mod_rewrite rules for view link page
RewriteRule ^([^/]+)-l([0-9]+).html$ view-link.php?cat=&title=$1&id=$2 [QSA,L]
RewriteRule ^(.*)/([^/]+)-l([0-9]+).html$ view-link.php?cat=$1&title=$2&id=$3 [QSA,L]
# mod_rewrite rules for news page
RewriteRule ^(.*)-n([0-9]+).html$ news.php?title=$1&id=$2 [QSA,L]
RewriteRule ^news.html$ news.php [QSA,L]
RewriteRule ^news([0-9]+).html$ news.php?page=$1 [QSA,L]
# mod_rewrite rules for additional pages
RewriteRule ^p(.*).html$ page.php?name=$1 [QSA,L]
# mod_rewrite rules for error pages
RewriteRule ^([0-9]+).htm$ error.php?error=$1 [QSA,L]
# mod_rewrite rules for suggest link page
RewriteRule ^suggest-link-([0-9]+).html$ suggest-link.php?id=$1 [QSA,L]
# mod_rewrite rules for suggest category page
RewriteRule ^suggest-category-([0-9]+).html$ suggest-category.php?id=$1 [QSA,L]
# Google Sitemap
RewriteRule ^sitemap.xml$ google-sitemap.php [QSA,L]
# Yahoo site feed
RewriteRule ^urllist.txt$ yahoo-feed.php [QSA,L]
ErrorDocument 500 500.htm
ErrorDocument 404 404.htm
ErrorDocument 403 403.htm
ErrorDocument 401 401.htm
Luckyjj842
08-18-2007, 10:41 AM
Hi MOT,
Thanks again for response and advice.
Sadly, I still could not get this to work. I replaced my .htaccess with your text above and enabled Apache mod_rewrite module in Esyndicate Admin area.
This then corrupted the pages. It looked like it was not pointing to the correct directory or something.
Currently I have my Esyndicate script in a folder called "dir" on my route directory. (yellow folder using 1and1)
My Esyndicate admin points as follows:
Base URL to script: http://newspapergroup.co.uk
Site title: Newspaper Group
Path in filesystem to script: /kunden/homepages/32/d86785579/htdocs/dir
Directory where eSyndiCat is installed: /
I hope this may highlight what is going wrong.
Thanks again for any advice you can offer.
John
Hi MOT,
My Esyndicate admin points as follows:
Base URL to script: http://newspapergroup.co.uk
Site title: Newspaper Group
Path in filesystem to script: /kunden/homepages/32/d86785579/htdocs/dir
Directory where eSyndiCat is installed: dir/
I hope this may highlight what is going wrong.
Thanks again for any advice you can offer.
John
Well, the portion I included in red should point it correctly. Where you have /kunden listed, that portion in blue I presently don't use, but seeing as that is what the installer may have seen I wouldn't touch that right now. Go with the change in red first.
Hey Guys,
I have tons of directories running on 1and1 with no problem!
It was posted many, many times!
For 1and1 you MUST have these two additional lines in your .htacces file for the script to work properly:
This is how beginning of your .htaccess file has to look:# enable mod_rewrite
Options -MultiViews
RewriteEngine on
RewriteBase /
Line in green necessary for the news pages to work
Line in red should reflect the folder where eSyndicat script is installed for mod_rewrite to work
Looks like Lucky still did not add RewriteBase line...
Also you should not use names like "dir" for the installation folder - this is common DOS command...
Use something like "links", "listings", "resources" or something related to your site if you have to install in the subfolder...
Hey Guys,
I have tons of directories running on 1and1 with no problem!
It was posted many, many times!
Yes, if you drill through the forums time and again someone just might find what they need.
For 1and1 you MUST have these two additional lines in your .htacces file for the script to work properly:
This is how beginning of your .htaccess file has to look:# enable mod_rewrite
Options -MultiViews
RewriteEngine on
RewriteBase /
Line in green necessary for the news pages to work
Line in red should reflect the folder where eSyndicat script is installed for mod_rewrite to work
"RewriteEngine on" is a given with 1and1, must have that at least ,it's the other line you mentioned I haven't seen before and did in fact solve a problem I had AFTER getting everything else working. That's good info.
Also you should not use names like "dir" for the installation folder - this is common DOS command...
Funny, that's recommended in the eSyndicat online docs. Guess you need to tell them to change that. Besides, what does it matter, DOS isn't in operation here, unless of course it affects search spiders. There again I point to the docs if anyone is guilty.
Maybe it would be better to have a category in the forums with verifiably functioning examples of .htaccess files (in their entirety and not snippets) for each of the major hosting companies seeing as 1and1 is a good example of where the generic file does not work.
Luckyjj842
08-19-2007, 10:29 AM
Hi WTM and MOT
Thanks again both of you for your advice. I will get there in the end!!
I have replaced my .htaccess with the following information as recommended:
# enable mod_rewrite
Options -MultiViews
RewriteEngine on
RewriteBase /
As my Esyndicate is in a folder called "dir" at 1and1 I inintially changed it to:
RewriteBase dir/
I enabled Apache mod_rewrite module in Esyndicate and changed my Directory where eSyndiCat is installed / (to:)
Directory where eSyndiCat is installed dir/
This did not work again. I then changed the .htaccess back without the folder name:
# enable mod_rewrite
Options -MultiViews
RewriteEngine on
RewriteBase /
and my Directory where eSyndiCat is installed /
This now works (nearly)!!!
It has allowed friendly urls (FANTASTIC) but the Titles on Top Page:
NEW LINKS
POPULAR LINKS
TOP LINKS
When clicked now have Error 404 - Not found
Your browser can't find the document corresponding to the URL you typed in.
Any ideas?
Thanks again
John
vBulletin® v3.7.0, Copyright ©2000-2008, Jelsoft Enterprises Ltd.